while True:
try:
s = input().strip().split(' ')[::-1]
for x in s:
x = x[::-1]
print(x, end=' ')
except:
break
while True:
try:
s = input().strip().split(' ')[::-1]
for x in s:
x = x[::-1]
print(x, end=' ')
except:
break