def numbers(number):
a = []
while number > 0:
a.append(number%10)
number //= 10
for i in range(len(a)-1,0-1,-1):
print(a[i])
x = int(input())
numbers(x)
def numbers(number):
a = []
while number > 0:
a.append(number%10)
number //= 10
for i in range(len(a)-1,0-1,-1):
print(a[i])
x = int(input())
numbers(x)