1)
sm = 0
for i in range(1000, 10000):
i = str(i)
if i[0] == i[3] and i[1] == i[2]:
sm += int(i)
print(sm)
2)
lst = [int(i) for i in input().split()]
for i in lst:
if i % 10 == 2 and i % 6 == 0:
print(i)
1)
sm = 0
for i in range(1000, 10000):
i = str(i)
if i[0] == i[3] and i[1] == i[2]:
sm += int(i)
print(sm)
2)
lst = [int(i) for i in input().split()]
for i in lst:
if i % 10 == 2 and i % 6 == 0:
print(i)