You are given an integer sequence of length n, a_1, ..., a_n. Let us consider performing the following n operations on an empty sequence b.  The i-th operation is as follows:    1. Append a_i to the end of b.   2. Reverse the order of the elements in b.  Find the sequence b obtained after these n operations.
n=int(input())
a=list(input().split())
b=[]

if n%2!=0:
    for i in range(n):
        if i%2!=0:
            b.insert(0,a[i])
        else:
            b.append(a[i])
else:
    for i in range(n):
        if i%2==0:
            b.insert(0,a[i])
        else:
            b.append(a[i])
print(" ".join(b))


n=int(input())
a=list(input().split())
b1=[]
b2=[]
if n%2==0:
    for i in range(n):
        if i%2!=0:
            b1.append(a[n-i])
        else:
            b2.append(a[i])
else:
    for i in range(n):
        if i%2==0:
            b1.append(a[n-1-i])
        else:
            b2.append(a[i])

b1.extend(b2)

print(" ".join(b1))