반응형
while True:
s = input().split()
if s == ['#']:
break
li = list(map(lambda x: x[0] if len(x) == 1 else x[0] + x[1:-1][::-1] + x[-1], s))
print(' '.join(li))
while True:
s = input().split()
if s == ['#']:
break
li = list(map(lambda x: x[0] if len(x) == 1 else x[0] + x[1:-1][::-1] + x[-1], s))
print(' '.join(li))