from yogi import *

for n in tokens(int):
    print(reduction_of_digits(n))
