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.
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.