n = input() step = 0 while n != n[::-1]: n = str(int(n) + int(n[::-1])) step += 1 print("%d %s" % (step, n))