Mutint

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

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.