# 2760 - entrada e saida de string
a = input()
b = input()
c = input()

print('{}{}{}'.format(a,b,c))
print('{}{}{}'.format(b,c,a))
print('{}{}{}'.format(c,a,b))
print('{:.10}{:.10}{:.10}'.format(a,b,c))

