li = list(map(int, input().strip().split()))
#print(li)
stack = list()
left = 1
n = 1
count = 1
while li:
tmp = list()
while li and n:
cur = li.pop(0)
if left:
tmp.insert(0, cur)
else:
tmp.append(cur)
n -= 1
stack = stack + tmp
left = (left+1)%2
count *= 2
n = count
print(' '.join(map(str, stack)))