while True:
a = int(input())
a = a**2
if a == 0:
break
print(a)
while True:
a = int(input())
if a % 3 == 0 and 10 < a < 50:
print(a)
elif a == 0:
break
x = list()
while(True):
temp = int(input())
if(temp != 0):
x.append(temp)
else:
break
for y in x:
print(y * y)
x = list()
while(True):
temp = int(input())
if(temp != 0):
x.append(temp)
else:
break
for y in x:
if((y % 3 == 0) and (y > 0) and (y <= 50 and y >= 10)):
print(y)
3) temp = input()
print(temp.replace("."," "))
4)
temp1 = 0
while(True):
temp = input()
if(temp == "конец"):
print(temp1)
break
else:
temp1 += int(temp)
5) number = input()
temp = 0
for x in number:
temp += int(x)
print(temp)
a = []
while b := int(input()):
a += [b ** 2]
print(*a, sep='\n')
2) a = []
while b := int(input()):
if not b % 3 and 10 <= b <= 50:
a += [b]
print(*a, sep='\n')
3) print(input().replace('.', ' '))
4) s = 0
while (b := input()) != 'конец':
if b.isnumeric():
s += int(b)
print(s)
5) s, n = 0, abs(int(input()))
while n:
s += n % 10
n //= 10
print(s)