CodeEff/ECCO huggingface dataset:
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
b=[]
for i in range(n):
    b.append(a[i])
    b.reverse()
map_b=list(map(str,b))
v=" ".join(map_b)
print(v)

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
a.reverse()
ans=[]
re_ans=[]
if n==1:
    print((a[0]))
else:
    ans=a[::2]
    re_ans=a[1::2]
    re_ans.reverse()
    ans.extend(re_ans)
    map_ans=list(map(str,ans))
    v=" ".join(map_ans)
    print(v)
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = []
if n % 2 == 0:
    for i in range(n-1,0,-2):
        ans = ans + [a[i]]
    for i in range(0,n,2):
        ans = ans + [a[i]]
else:
    for i in range(n-1,-1,-2):
        ans = ans + [a[i]]
    for i in range(1,n,2):
        ans = ans + [a[i]]
print((' '.join([str(i) for i in ans])))


# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = []
if n % 2 == 0:
    for i in range(n-1,0,-2):
        ans.append(a[i])
    for i in range(0,n,2):
        ans.append(a[i])
else:
    for i in range(n-1,-1,-2):
        ans.append(a[i])
    for i in range(1,n,2):
        ans.append(a[i])
print((' '.join([str(i) for i in ans])))
# Original solution
N = int(eval(input()))
char = input().split()
out = []
for x in range(0,N):
    out.append(char[x])
    out.reverse()
print((" ".join(out)))

# Optimized solution
n = int(eval(input()))
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s) % 2:
        print((" ".join(s1[::-1]) +" "+ " ".join(s2)))
    else:
        print((" ".join(s2[::-1]) +" "+ " ".join(s1)))
else:
    print((" ".join(s1)))
# Original solution
n = int(eval(input()))
a = input().split()

b = []

for i in a:
    b.append(i)
    b.reverse()

print((" ".join(b)))


# Optimized solution
n = 4
a = [1, 2, 3, 4]

n = int(eval(input()))
a = input().split()


if n % 2 == 0:
    y = [a[j] for j in range(1, n, 2)][::-1]
    z = [a[j] for j in range(0, n, 2)]

else:
    y = [a[j] for j in range(0, n, 2)][::-1]
    z = [a[j] for j in range(1, n, 2)]

print((" ".join(map(str, y + z))))
# Original solution
n =int(eval(input()))
ls = []

if n%2==0:
    for i,j in enumerate(input().split()):
        if i%2==0:
            ls.append(j)
        else:
            ls.insert(0,j)
else:
    for i,j in enumerate(input().split()):
        if i%2==1:
            ls.append(j)
        else:
            ls.insert(0,j)

print((" ".join(ls)))

# Optimized solution
n =int(eval(input()))
a = list(map(str,input().split()))
lss = []
lse = []
if n%2==0:
    for i in range(n//2):
        lss.append(a[2*i])
    for i in range(n//2):
        lse.append(a[n-(2*i+1)])

else:
    for i in range(n//2):
        lss.append(a[2*i+1])
    for i in range(n//2+1):
        lse.append(a[n-2*i-1])


ls = lse+lss

print((" ".join(ls)))
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
b = []
for i in range(n):
    if  i % 2 == 1:
        b = b + [a[i]]
    else:
        b = [a[i]] + b
if n % 2 == 0:
    b.reverse()
print((' '.join(map(str,b))))

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
b = []
c = []
for i in range(n):
    if  i % 2 == 1:
        b.append(a[i])
    else:
        c.append(a[i])
if n % 2 == 0:
    b.reverse()
    ans = b + c
else:
    c.reverse()
    ans = c + b
print((' '.join(map(str,ans))))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
b = []
for i in a:
    b.append(str(i))
    b = b[::-1]
print((' '.join(b)))

# Optimized solution
n = int(eval(input()))
a = list(map(str, input().split()))
b = a[::-2] + a[len(a)%2::2]
print((' '.join(b)))
# Original solution
n = int(eval(input()))
a = list(map(str, input().split()))
b = a[::-2] + a[len(a)%2::2]
print((' '.join(b)))

# Optimized solution
n = int(eval(input()))
a = input().split()
print((' '.join(a[::-2] + a[n%2::2])))
# Original solution
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())|	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

import collections
def inpl(): return list(map(int, input().split()))

#### START
n = int(input())
a = list(map(int,input().split()))

b = []
for a_i in a:
  b.append(a_i)
  b.reverse()

print(*b, sep=" ")


# Optimized solution
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())|	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

import collections
def inpl(): return list(map(int, input().split()))

#### START
n = int(input())
a = list(map(int,input().split()))

b = a[::2]
c = a[1::2]

if n%2 == 0:
  ans = list(reversed(c)) + b
  print(*ans, sep=" ")
else:
  ans = list(reversed(b)) + c
  print(*ans, sep=" ")
# Original solution
from collections import deque
n = int(input())
A = list( map( int, input().split()))
B = deque()
reverse = 0
for i in range(n):
    if reverse == 0:
        B.append(A[i])
        reverse = 1
    else:
        B.appendleft(A[i])
        reverse = 0
B = list(B)
if reverse == 1:
    B = B[::-1]
for i in range(n-1):
    print(B[i], end = ' ')
print(B[n-1])


# Optimized solution
from collections import deque
n = int(eval(input()))
A = list( map( int, input().split()))
B = deque()
reverse = 0
for i in range(n):
    if reverse == 0:
        B.append(A[i])
        reverse = 1
    else:
        B.appendleft(A[i])
        reverse = 0
B = list(B)
if reverse == 1:
    B = B[::-1]
print(( ' '.join( list( map(str, B)))))
# Original solution
n=int(input())
l=list(map(int,input().split()))
ans=[]
for i in range(n):
    ans.append(l[i])
    ans.reverse()
for i in range(n-1):
    print(ans[i],end=" ")
print(ans[n-1])


# Optimized solution
n=int(input())
l=list(map(int,input().split()))
ans=[-1]*n
l.reverse()
for i in range(n):
    if i%2==0:
        ans[i//2]=l[i]
    else:
        ans[n-1-((i-1)//2)]=l[i]


for i in range(n-1):
    print(ans[i],end=" ")
print(ans[n-1])
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = []
for i in a:
    ans.append(i)
    ans = ans[::-1]
let = ""
for j in ans:
    let += str(j) + " "
print((let[:-1]))

# Optimized solution
n = int(eval(input()))
a = list(input().split())
ans = ' '.join(a[::-2])
if n % 2 == 0:
    ans += " " + ' '.join(a[::2])
else:
    ans += " " + ' '.join(a[1::2])
print(ans)
# Original solution
from collections import deque
n = int(eval(input()))
a = list(map(int, input().split()))
b = deque()

ok = True
for i in range(n):
  if ok:
    b.append(a[i])
    ok = False
  else:
    b.appendleft(a[i])
    ok = True

b = list(map(str, list(b)))
if ok:
  print((" ".join(b)))
else:
  print((" ".join(b[::-1])))

# Optimized solution
from collections import deque
n = int(eval(input()))
a = list(input().split())
ans = deque()
for i in range(n):
    if i%2==0: ans.append(a[i])
    else: ans.appendleft(a[i])
ans = list(ans)
if n%2==0:
    print((" ".join(ans)))
else:
    print((" ".join(ans[::-1])))
# Original solution
N=int(eval(input()))


b=[]
k=N%2
for a in list(map(int,input().split())):
    if k==a%2:
        b.insert(0,a)
    else:
        b.append(a)
print((' '.join(map(str,b))))

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
print((' '.join(map(str,A[::-2]+A[N%2::2]))))
# Original solution
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.insert(0,a[i])

if n % 2 == 1:
    b = b[::-1]

if len(b) == 1:
    print(b[0])

else:
    for i in range(len(b)-1):
        print(b[i], end=" ")
    print(b[i+1])


# Optimized solution
n = int(input())
a = list(map(int, input().split()))
b = [0]*n
for i in range(n):
    if i % 2 == 0:
        b[n//2+i//2] = a[i]
    else:
        b[n//2-i//2-1] = a[i]
        
if n % 2 == 1:
    b = b[::-1]

if len(b) == 1:
    print(b[0])

else:
    for i in range(len(b)-1):
        print(b[i], end=" ")
    print(b[i+1])
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

b = []

front = False
for i in a:
    if front:
        b.insert(0, i)
        front = False
    else:
        b.append(i)
        front = True



if front:
    b.reverse()


b = list(map(str, b))
b = " ".join(b)
print(b)

# Optimized solution
n = int(input())
a = list(map(int, input().split()))
'''
b = []

front = False
for i in a:
    if front:
        b.insert(0, i)
        front = False
    else:
        b.append(i)
        front = True




if front:
    b.reverse()


b = list(map(str, b))
b = " ".join(b)
print(b)
'''


first = a[0:n:2]
last = a[1:n:2]
last = last[::-1]
answer = last + first
if n%2 != 0:
    answer = answer[::-1]

print(*answer, sep=" ")
# Original solution
n = int(input())

a = [x for x in input().split()]
b = []
for i in range(n):
    b.append(a[i])
    b.reverse()
    
print(*b, sep=' ')


# Optimized solution
n = int(input())
a = [x for x in input().split()]
b = []

if n % 2 == 1:
    for i in reversed(range(1, n+1, 2)):
        b.append(a[i-1])
    for i in range(2, n, 2):
        b.append(a[i-1])
else:
    for i in reversed(range(2, n+1, 2)):
        b.append(a[i-1])
    for i in range(1, n, 2):
        b.append(a[i-1])
    
print(*b, sep=' ')
# Original solution
from collections import deque

n = int(eval(input()))
A = list(map(int, input().split()))
B = deque()
for i in range(n):
    B.append(A[i])
    B.reverse()
 
text = ""
for b in B:
    text += str(b) + " "
text = text[:-1]
print(text)

# Optimized solution
from collections import deque

n = int(eval(input()))
A = list(map(int, input().split()))
B = deque()
for i in range(n):
    if(i%2 == 0):
        B.append(A[i])
    if(i%2 == 1):
        B.appendleft(A[i])

if(n%2 == 1):
    B.reverse()
text = ""
for b in B:
    text += str(b) + " "
text = text[:-1]
print(text)
# Original solution
n = int(eval(input()))
a = [int(i) for i in input().split()]

b = []
count = 0
for i in a:
  if count % 2 == 0:
    b.append(i)
  else:
    b.insert(0, i)
  count += 1

if n % 2 == 0:
  print((' '.join([str(i) for i in b])))
else: 
  b.reverse()
  print((' '.join([str(i) for i in b])))


  

# Optimized solution
n=int(eval(input()))
a=list(input().split())
b=[]
if len(a)%2==0:
  for i in range(n-1,0,-2):
    b.append(a[i])
  for i in range(0,n-1,2):
    b.append(a[i])
else:
  for i in range(n-1,-1,-2):
    b.append(a[i])
  for i in range(1,n-1,2):
    b.append(a[i])
print((' '.join(b)))
# Original solution
n = int(eval(input()))
a = [int(x) for x in input().split()]

b = []
ap = b.append

for i in range(n):
  ap(a[i])
  b.reverse()

print((' '.join(map(str, b))))

# Optimized solution
n = int(eval(input()))
a = input().split()

if n & 1:
  print((' '.join(a[::-2]+a[1::2])))
else:
  print((' '.join(a[-1:0:-2]+a[::2])))
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
b=[]
for i in range(n):
  if i%2==0:
    b.append(a[i])
  else:
    b.insert(0,a[i])
if n%2==0:
  print((' '.join(map(str, b))))
else:
  print((' '.join(map(str, list(reversed(b))))))

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
b0=[]
b1=[]
for i in range(n):
  if i%2==0:
    b0.append(a[i])
  else:
    b1.append(a[i])
if n%2!=0:
  b0=list(reversed(b0))
  b=b0+b1
  print((' '.join(map(str, b))))
else:
  b1=list(reversed(b1))
  b=b1+b0
  print((' '.join(map(str, b))))
# Original solution
def main():
    n = int(eval(input()))
    A = input().split()
    ans = []
    if n % 2 == 0:
        for i in range(0, n - 1, 2):
            ans.append(A[i])
            ans = [A[i + 1]] + ans
    else:
        for i in range(0, n - 1, 2):
            ans.append(A[i + 1])
            ans = [A[i]] + ans
        ans = [A[-1]] + ans
    print((' '.join(ans)))


main()


# Optimized solution
def main():
    n = int(eval(input()))
    A = input().split()
    B = [0] * n
    k = n % 2
    l = n // 2
    if k == 0:
        l -= 1
    r = l + 1
    for i in range(n):
        if i % 2 != k:
            B[l] = A[i]
            l -= 1
        else:
            B[r] = A[i]
            r += 1
    print((' '.join(B)))


main()
# Original solution
def main():
    n = int(eval(input()))
    A = input().split()
    B = [0] * n
    k = n % 2
    l = n // 2
    if k == 0:
        l -= 1
    r = l + 1
    for i in range(n):
        if i % 2 != k:
            B[l] = A[i]
            l -= 1
        else:
            B[r] = A[i]
            r += 1
    print((' '.join(B)))


main()


# Optimized solution
def main():
    n = int(eval(input()))
    A = input().split()
    if n % 2 == 0:
        print((' '.join(A[1::2][::-1] + A[0::2])))
    else:
        print((' '.join(A[0::2][::-1] + A[1::2])))


main()
# Original solution
N = int(eval(input()))
a = list(input().split())

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

# Optimized solution
N = int(eval(input()))
a = list(input().split())

print((" ".join(a[-1::-2] + a[N%2::2])))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
b = []

for i in range(n):
  b.append(a.pop(0))
  b = b[::-1]

print((' '.join(map(str, b))))

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))

a_even = [elm_a for i, elm_a in enumerate(a) if i % 2 == 0]
a_odd = [elm_a for i, elm_a in enumerate(a) if i % 2 == 1]

ans = a_even[::-1] + a_odd
if n % 2 == 0:
  ans = ans[::-1]

print((' '.join(map(str, ans))))
# Original solution
if(__name__ =="__main__"):
    N = int(eval(input()))
    a =[int(i) for i in input().split()]
    b = []
    for i in range(N):
        b.append(a[i])
        #print(b)
        b = b[::-1]
        #print(b)
    print((' '.join(map(str,b))))

# Optimized solution
if(__name__ =="__main__"):
    N = int(eval(input()))
    a =[int(i) for i in input().split()]
    b = []
    for i in range(N-1,-1,-2):
        b.append(a.pop(i))
        #print(b)
        # b = b[::-1] TLE:O(N)    
        #print(b)
    b.extend(a)
    print((' '.join(map(str,b))))
# Original solution
n = int(eval(input()))
num_list = [ v for v in input().split() ]

b_list = []

for i in num_list:
	b_list.append(i)
	b_list.reverse()
print((" ".join(b_list)))

# Optimized solution
n = int(eval(input()))
num_list = [ v for v in input().split() ]

if n % 2 == 0:
	print((" ".join(num_list[::-2]+num_list[::2])))
else:
	print((" ".join(num_list[::-2]+num_list[1::2])))
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
b =[]
for i in range(1,n+1):
 if (n%2)==(i%2):
    b.insert(0,a[i-1])
 else:
    b.append(a[i-1])
print((' '.join(map(str,b))))

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
o =a[::2]
e =a[1::2]
if len(a)%2==0:
    ans = e[::-1]+o
elif len(a)==1:
    ans = a
else:
    ans = o[::-1]+e
print((' '.join(map(str,ans))))
# Original solution
from collections import deque

def resolve():
	n = int(eval(input()))
	a = list(map(int, input().split()))
	b = [0]*n
	d = deque()
	h = len(b) // 2
	for i in range(1, n+1):
		if n % 2 == i % 2:
			d.appendleft(str(a[i-1]))
		else:
			d.append(str(a[i-1]))
	print((" ".join(d)))
resolve()

# Optimized solution
from collections import deque


def resolve():
	n = int(eval(input()))
	a = list(map(int, input().split()))
	d = deque()
	is_even = True if n % 2 == 0 else False
	for i in range(n):
		if is_even:
			if (i+1) % 2 == 0:
				d.appendleft(a[i])
			else:
				d.append(a[i])
		else:
			if (i+1) % 2 == 0:
				d.append(a[i])
			else:
				d.appendleft(a[i])

	print((" ".join(list(map(str, d)))))
resolve()
# Original solution
from collections import deque


def solve(a):
    ans = deque()

    for i, aa in enumerate(a):
        ans.append(str(aa))
        ans.reverse()

    return list(ans)


if __name__ == "__main__":
    n = int(eval(input()))
    a = list(map(int, input().split()))
    print((' '.join(solve(a))))


# Optimized solution
from collections import deque


def solve(a):
    ans = deque()

    for i, aa in enumerate(a):
        if i % 2 == 0:
            ans.append(str(aa))
        else:
            ans.appendleft(str(aa))

    if len(a) % 2 == 1:
        ans.reverse()

    return list(ans)


if __name__ == "__main__":
    n = int(eval(input()))
    a = list(map(int, input().split()))
    print((' '.join(solve(a))))
# Original solution
n = int(eval(input()))
a_list = list(map(int, input().split()))

b_list = []

for i, a in enumerate(a_list):
    if i % 2 == 0:
        b_list.insert(0, a)
    else:
        b_list.append(a)

if n % 2 ==0:
    b_list.reverse()
print((" ".join(map(str, b_list))))


# Optimized solution
n = int(eval(input()))
a_list = list(map(int, input().split()))

b_list_even = []
b_list_odd = []
for i, a in enumerate(a_list , start=1):
    if i % 2 == 0:
        b_list_even.append(a)
    else:
        b_list_odd.append(a)


if n % 2 != 0:
    b_list_odd.reverse()
    b_list = b_list_odd + b_list_even
else:
    b_list_even.reverse()
    b_list = b_list_even + b_list_odd

print((" ".join(map(str, b_list))))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
b = []
for i in range(n):
    if i % 2 == n % 2:
        b.append(a[i])
    else:
        b.insert(0, a[i])
print((' '.join(map(str, b))))   

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
b1 = []
b2 = []
for i in range(n):
    if i % 2 == 0:
        b1.append(a[i])
    else:
        b2.append(a[i])
if n % 2 == 0:
    b2.reverse()
    b = b2 + b1
else:
    b1.reverse()
    b = b1 + b2
    
print((' '.join(map(str, b))))
# Original solution
from collections import deque
n, l, b = eval(input()), input().split(), deque()
for t in range(n):
    b.append(l[t])
    b.reverse()
print(' '.join(b))

# Optimized solution
from collections import deque
n, l, b = eval(input()), input().split(), deque()
for t in range(n):
    if (t + 1) % 2:
        b.append(l[t])
    else:
        b.appendleft(l[t])
print(' '.join(reversed(b)) if n % 2 else ' '.join(b))
# Original solution
from collections import deque
n, l, b = eval(input()), input().split(), deque()
for t in range(n):
    b.append(l[t]) if (t + 1) % 2 else b.appendleft(l[t])
print(' '.join(reversed(b)) if n % 2 else ' '.join(b))

# Optimized solution
n, l = eval(input()), input().split()
print(' '.join(l[0::2][::-1] + l[1::2]) if len(l) % 2 else ' '.join(l[1::2][::-1] + l[0::2]))
# Original solution
n = int(eval(input()))
a = input().split()
b = []
if n % 2:
    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:
            b.insert(0, a[i])
        else:
            b.append(a[i])

print((' '.join(b)))


# Optimized solution
n = int(eval(input()))
a = input().split()
even = a[::2]
odd =a [1::2]

if n % 2:
    even = even[::-1]
    b = even + odd
else:
    odd = odd[::-1]
    b = odd + even

print((' '.join(b)))
# Original solution
n = int(input())
s = []
X = list(map(int, input().split()))
for i in range(n):
    a = X[i]
    s.append(a)
    s.reverse()
for i in s:
    print(i, end = '')
    if(i!= n - 1):
        print(' ', end='')
print()


# Optimized solution
n = int(eval(input()))
s = ''
X = list(map(int, input().split()))
if(len(X) % 2 == 0):
    for i in range(0, n, 2):
        s += str(X[n - 1 - i])
        s += ' '
    for i in range(0, n, 2):
        s += str(X[i])
        s += ' '
else:
    for i in range(0, n, 2):
        s += str(X[n - i - 1])
        s += ' '
    for i in range(1, n, 2):
        s += str(X[i])
        s += ' '
print((s[:-1]))
# Original solution
import sys

n = int(eval(input()))
a = list(map(int, sys.stdin.readline().split()))
ans = []
for i in range(n):
    if i % 2 == 0:
        ans.insert(0, a[i])
    else:
        ans.append(a[i])

if len(a) % 2 == 0:
    ans.reverse()
print((' '.join(map(str,ans))))


# Optimized solution
import sys

n = int(eval(input()))
a = list(map(int, sys.stdin.readline().split()))

odd = a[1::2]
even = a[0::2]
odd.reverse()
ans = odd+even

if(len(a) % 2 != 0):
    ans.reverse()

print((' '.join(map(str, ans))))
# Original solution
n = int(eval(input()))
A = input().split()
b = []
for i,a in enumerate(A):
    if i%2==0:
        b.insert(0,a)
    else:
        b.append(a)
print((' '.join(reversed(b)) if n%2==0 else ' '.join(b)))

# Optimized solution
n = int(input())
A = input().split()
if n%2==0:
    print(' '.join(A[1::2][::-1]),end=' ')
    print(' '.join(A[::2]))
else:
    print(' '.join(A[::2][::-1]),end=' ')
    print(' '.join(A[1::2]))
# Original solution
n=int(eval(input()))
a=list(input().split())
b=[]
if n%2==0:
    for i in range(n):
        if i==0:
            b.append(a[i])
        elif i%2==0:
            b.append(a[i])
        else:
            b.insert(0,a[i])
else:
    for i in range(n):
        if i==0:
            b.append(a[i])
        elif i%2==0:
            b.insert(0,a[i])
        else:
            b.append(a[i])
print((' '.join(b)))


# Optimized solution
n=int(eval(input()))
a=list(input().split())
b=a[::-2]+a[len(a)%2::2]
print((' '.join(b)))
# Original solution
from collections import deque
N=int(eval(input()))
A=tuple(map(str,input().split()))
B=deque()
for i in range(N):
  B.append(A[i])
  B.reverse()
ans=' '.join(list(B))
print(ans)

# Optimized solution
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],end=' ')
print(*A[N%2::2])
# Original solution
n = int(eval(input()))
a = list(map(str, input().split()))
if n % 2 == 0:
    ki = a[::2]
    gu = a[1::2]
    gu = gu[::-1]
    ans = gu+ki
else:
    ki = a[::2]
    ki = ki[::-1]
    gu = a[1::2]
    ans = ki+gu
    
print((' '.join(ans)))

# Optimized solution
n = int(eval(input()))
a = list(input().split())
if n % 2 == 0:
    ans = a[::-2]+a[::2]
else:
    ans = a[::-2]+a[1::2]
print((' '.join(ans)))
# Original solution
n = int(eval(input()))
a = [int(i) for i in input().split()]

if n % 2 == 0:
    a1 = a[::2]
    a2 = a[1::2]
    a2 = a2[::-1]

    ans = a2 + a1
else:
    a1 = a[::2]
    a1 = a1[::-1]
    a2 = a[1::2]

    ans = a1 + a2

ans = list(map(str, ans))
print((' '.join(ans)))

# Optimized solution
n = int(eval(input()))
a = [int(i) for i in input().split()]

if n % 2 == 0:
    lis1 = a[::2]
    lis2 = a[::-2]
    ans = lis2 + lis1
else:
    lis1 = a[::-2]
    lis2 = a[1::2]
    ans = lis1 + lis2
ans = list(map(str, ans))
print((' '.join(ans)))
# Original solution
n = int(eval(input()))
A = list(map(int, input().split()))

B = []

for i in A:
    B.append(str(i))
    B = list(reversed(B))
print((" ".join(B)))

# Optimized solution
n = int(eval(input()))

A = list(map(int, input().split()))

B = []
C = []

for i in range(n):
    if i % 2 == 0:
        B.append(str(A[i]))
    else:
        C.append(str(A[i]))

if n % 2 == 0:
    s = " ".join(list(reversed(C)))
    t = " ".join(B)
    print((s + " " + t))
else:
    s = " ".join(list(reversed(B)))
    t = " ".join(C)
    print((s + " " + t))
# Original solution
n = int(eval(input()))
a = list(input().split())
b = []
if n%2==1:
    for i in a:
        if int(i)%2==1: b.insert(0,i)
        else:  b.append(i)
else:
    for i in a:
        if int(i)%2==0: b.insert(0,i)
        else:  b.append(i)
print((" ".join(b)))

# Optimized solution
n = int(eval(input()))
a = list(input().split())
b = []
if n%2==1:
    b = a[::-2]+a[1::2]
else:
    b = a[::-2]+a[::2]
print((" ".join(b)))