Divisible by 3#7672

Divisible by 3

1 second
64 megabytes
Easy

The number is given. Stepan wants to replace one digit so that the new number will be divisible by and will be as maximal as possible. You must necessarily replace one digit, even if the number is already divisible by . As Stepan only started to attend the programming courses, he asks you to help.

Input

One positive integer is given. Its length is no more than digits.

Output

Print one positive integer satisfying the following conditions:

  • it must be different from the given number only in one digit.

  • it must be divisible by .

  • it must be as maximal as possible among all such numbers.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading