DMCA
Many people are aware of DMCA – Digital Millennium Copyright Act. But another recently proposed DMCA – Digital Millennium Calculation Act – is much less known.In this problem you need to find a root of a number according to this new DMCA law.
The input contains a single integer $$$a$$$ ($$$1 \le a \le 1000000$$$).
Output the result – an integer number.
print((int(input()) - 1) % 9 + 1)
s = input()

def sum_digits(s):
    return str(sum([int(c) - int('0') for c in s]))
while len(s) > 1:
    s = sum_digits(s)
print(s)
n = list(input())
while len(n) > 1:
    e = sum(list(map(int, n)))
    n = list(str(e))
print(*n)