x = list(map(int,input().split(' ')))
print (' '.join(map(str,(x[:2] + x[2:-2][::-1] + x[-2:]))))