1620
x = int(input())
def f(x):
sum = 0
while x > 0:
sum = sum + x % 10
x = x//10
return sum
y = f(x)
while y>=10:
y = f(y)
print(y)
1440
x = int(input())
data = list(map(int, input().split()))
def f(x):
for i in range(0,x):
print(i+1,":", sep="",end=" ")
for j in range(0,x):
if i != j :
if data[i] < data[j]:
print("<", end=" ")
elif data[i] > data[j]:
print(">", end=" ")
else:
print("=", end=" ")
print()
f(x)
1567
x = int(input())
data = list(map(int, input().split()))
y, z = input().split()
y = int(y)
z = int(z)
def f(y,z):
sum = 0
for i in range(y-1,z):
sum = sum + data[i]
return sum
print(f(y,z))
1571
x = int(input())
data = list(map(int, input().split()))
y = int(input())
def f(y):
for i in range(x):
if y < data[i]:
return (i+1)
return (x+1)
print(f(y))