시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB106655258.427%

문제

A “Mutint” is an integer M that is changed according to certain criteria, such as in this problem. Given a positive integer, change M according to the following rules.

  1. Find the leftmost largest digit D of M.
  2. If D is odd, change it to a zero.
  3. If D is even, add 4 to that digit. If the sum exceeds 9, change D to the one’s place of the sum.

입력

Several integers, each on one line. The end of input is signaled with a zero on the last line. All integers, except the last integer, are positive.

출력

M, according to the rules above. M cannot have leading zeros.

예제 입력 1

132
1421
18234
923
0

예제 출력 1

102
1821
12234
23