l=input().split()
print(*l if len(l)==4 else (l[0],l[1],' '.join(list(map(str, [i for i in l[-3:1:-1]]))),l[-2],l[-1]))