LogiQuest

495. Maximum 69 Number

EasyGreedy

The number consists only of digits 6 and 9. Change at most one digit to get the largest possible number and print it.

Input format

One integer

Output format

The maximum number.

Example 1

Input

9669

Output

9969

Example 2

Input

9996

Output

9999

Constraints

1 ≤ n ≤ 10⁴

Read input from standard input and print the answer to standard output. Your code is judged against 4 test cases, most of them hidden.

Loading the MyLoginn IDE…