Problem:
 Score : 300 points    Problem Statement 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:   Append a_i to the end of b .  Reverse the order of the elements in b .   Find the sequence b obtained after these n operations.      Constraints  1 \leq n \leq 2\times 10^5  0 \leq a_i \leq 10^9  n and a_i are integers.         Input Input is given from Standard Input in the following format:  n  a_1  a_2  ...  a_n       Output Print n integers in a line with spaces in between.
The i -th integer should be b_i .        Sample Input 1 4
1 2 3 4      Sample Output 1 4 2 1 3   After step 1 of the first operation, b becomes: 1 .  After step 2 of the first operation, b becomes: 1 .  After step 1 of the second operation, b becomes: 1, 2 .  After step 2 of the second operation, b becomes: 2, 1 .  After step 1 of the third operation, b becomes: 2, 1, 3 .  After step 2 of the third operation, b becomes: 3, 1, 2 .  After step 1 of the fourth operation, b becomes: 3, 1, 2, 4 .  After step 2 of the fourth operation, b becomes: 4, 2, 1, 3 .   Thus, the answer is 4 2 1 3 .       Sample Input 2 3
1 2 3      Sample Output 2 3 1 2  As shown above in Sample Output 1, b becomes 3, 1, 2 after step 2 of the third operation. Thus, the answer is 3 1 2 .       Sample Input 3 1
1000000000      Sample Output 3 1000000000       Sample Input 4 6
0 6 7 6 7 0      Sample Output 4 0 6 6 0 7 7

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
if n==1:
  print(a[0])
else:
  print(*(a[n-1::-2]+(a[n-2::-2])[::-1]))

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
x,y=[],[]
for i in range(n):
    if(i%2==0):
        y.append(l[i])
    else:
        x.append(l[i])
if(n%2==0):
    print(*(x[::-1]+y))
else:
    print(*(y[::-1]+x))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
A.reverse()
B = []
C = []
for i, a in enumerate(A):
    if i%2==0:
        B.append(a)
    else:
        C.append(a)
print(*(B+list(reversed(C))))

Solution (Python):
from collections import deque
n = int(input())
b = deque()
Alist = list(map(int,input().split()))
i = 1
if n%2 == 0:
    for a in Alist:
        if i%2 == 0:
            b.appendleft(a)
        else:
            b.append(a)
        i += 1
else:
    for a in Alist:
        if i%2 == 0:
            b.append(a)
        else:
            b.appendleft(a)
        i +=1
print(*b)

Solution (Python):
from collections import deque
n = int(input())
a = list(map(int, input().split()))

d = deque()

for i in range(0,n,2):
    d.append(a[i])

for i in range(1,n,2):
    d.appendleft(a[i])

if n % 2 == 0:
    for i in d:
        print(i)
else:
    d.reverse()
    for i in d:
        print(i)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))

ans = [a[0]]
check = N%2==0
for i,j in enumerate(a[1:]):
    if(check):
        if(i%2==0):
            ans.insert(0,j)
        else:
            ans.append(j)
    else:
        if(i%2==1):
            ans.insert(0,j)
        else:
            ans.append(j)
print(" ".join(map(str,ans)))

Solution (Python):
from collections import deque

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

d = deque()

for i, a in enumerate(A):
    if i%2 == 0:
        d.append(a)
    else:
        d.appendleft(a)

if n%2==0:
    print(*d)
else:
    d = list(d)
    print(*d[::-1])

Solution (Python):
from collections import deque

n = int(input())
a = list(map(int, input().split()))
b = deque([])

for i, ai in enumerate(a):
    if i % 2 == 0:
        b.append(ai)
    elif i % 2 == 1:
        b.appendleft(ai)
b = list(b)
print(*(b if n % 2 == 0 else b[::-1]))

Solution (Python):


import sys
read = sys.stdin.read
readline = sys.stdin.readline

n,*a = map(int,read().split())


from collections import deque

q = deque()

flag = 0
for ai in a:
    if flag==0:
        q.append(ai)
    else:
        q.appendleft(ai)
    flag ^= 1

q = list(q)

if flag==0:
    print(*q)
else:
    print(*q[::-1])

Solution (Python):
from collections import *
n=int(input())
a=list(map(int,input().split()))
b=deque()
for i in range(n):
    if i%2==0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
b=list(b)
if n%2==0:
    print(*b)
else:
    print(*b[::-1])

Solution (Python):
from collections import deque
n=int(input())
a=list(map(str,input().split()))
d=deque()
for i in range(n):
    if i%2==0:
        d.appendleft(a[i])
    else:
        d.append(a[i])
d=list(d)
if n%2==0:
    d=d[::-1]
print(" ".join(d))

Solution (Python):
from collections import deque
n=int(input())
a=list(map(int,input().split()))
q=deque()
for i in range(n):
  if i%2==0:
    q.append(a[i])
  else:
    q.appendleft(a[i])
if n%2==1:
  q.reverse()
print(*q)

Solution (Python):
from collections import deque

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

b = deque([])
rev = 1
for i in a:
    if rev == 1:
        b.append(i)
    elif rev == -1:
        b.appendleft(i)
    rev *= -1

print(*(b if rev == 1 else list(b)[::-1]))

Solution (Python):
from collections import deque

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

b = deque([])
rev = 1
for i in a:
    if rev == 1:
        b.append(i)
        rev = -1
    elif rev == -1:
        b.appendleft(i)
        rev = 1

print(*(b if rev == 1 else list(b)[::-1]))

Solution (Python):
from collections import deque

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

b = deque([])

rev = 1
for i in a:
    if rev == 1:
        b.append(i)
        rev = -1
    elif rev == -1:
        b.appendleft(i)
        rev = 1

b = list(b)
print(*(b if rev == 1 else b[::-1]))

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
from collections import deque
b = deque([])
if n%2==0:
    for i in range(n):
        if i%2==1:
            b.appendleft(a[i])
        else:
            b.append(a[i])
else:
    for i in range(n):
        if i%2==1:
            b.append(a[i])
        else:
            b.appendleft(a[i])
print(" ".join(map(str,b)))

Solution (Python):
n = int(input())
alst = input().split()
lst1 = alst[::2]
lst2 = alst[1::2]
if n % 2:
  lst1.reverse()
  print(' '.join(lst1 + lst2))
else:
  lst2.reverse()
  print(' '.join(lst2 + lst1))

Solution (Python):


from collections import deque


def LI():
    return list(map(int, input().split()))


N = int(input())
A = LI()


def main():
    dq = deque()
    rev = False
    for a in A:
        if rev:
            dq.appendleft(a)
        else:
            dq.append(a)
        rev = not rev
    
    if rev:
        dq.reverse()
    
    print(*dq)


if __name__ == "__main__":
    main()

Solution (Python):
from collections import deque
n = int(input())
a = list(map(int,input().split()))

b = deque([])
for i in range(n):
    if i % 2 == 0:
        b.appendleft(a[i])
    if i % 2 == 1:
        b.append(a[i])
if n % 2 == 0:
    b = list(reversed(b))

print(*b)

Solution (Python):
a = int(input())
ar = list(map(int,input().split(" ")))
br = []
for i in range(a-1,-1,-2):
    br.append(ar[i])
if a % 2 == 0:
    n = 0
else:
    n = 1
for i in range(n,a-1,2):
    br.append(ar[i])
for i in range(a-1):
    print(br[i],end=" ")
print(br[a-1])

Solution (Python):
from collections import deque

n = int(input())
an = list(map(int, input().split(' ')))

d = deque()

for i in range(n):
    if i % 2 == 0:
        d.append(an[i])
    else:
        d.appendleft(an[i])

if n % 2 == 1:
    d.reverse()
    
result = list(map(str, d))
print(' '.join(result))

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
b = []
c = []
for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    if i % 2 == 1:
        c.append(a[i])
c.reverse()
c += b
if n % 2 == 1:
    c.reverse()
print(*c)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

if(len(a)%2 == 0):
    b = a[1::2][::-1]+a[0::2]
    print(' '.join(map(str, b)))
else:
    b = a[0::2][::-1]+a[1::2]
    print(' '.join(map(str, b)))

Solution (Python):
from collections import deque

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

S = deque()

for i in range(n):
    if (i % 2 == 1):
        S.append(a[i])
    else:
        S.appendleft(a[i])
    
if (n % 2 == 0):
    S.reverse()

print(" ".join(S))

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
if n%2==0:
    b=[a[n-1-2*i] for i in range(0,n//2)]
    c=[a[2*i] for i in range(0,n//2)]
    ans=b+c
    print(*ans)
else:
    b=[a[n-1-2*i] for i in range(0,(n-1)//2+1)]
    c=[a[2*i+1] for i in range(0,(n-1)//2)]
    ans=b+c
    print(*ans)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
odd = [A[i] for i in range(0, N) if not(i & 1)]
even = [A[i] for i in range(0, N) if i & 1]
ans = []
if N & 1:
    ans.extend(reversed(odd))
    ans.extend(even)
else:
    ans.extend(reversed(even))
    ans.extend(odd)
print(*ans)

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
from _collections import defaultdict
from functools import lru_cache

class Scanner():
    def int():
        return int(sys.stdin.readline().rstrip())
    def string():
        return sys.stdin.readline().rstrip()
    def map_int():
        return [int(x) for x in Scanner.string().split()]
    def string_list(n):
        return [input() for i in range(n)]
    def int_list_list(n):
        return [Scanner.mapInt() for i in range(n)]
    def int_cols_list(n):
        return [int(input()) for i in range(n)]
        
class Math():
    def gcd(a,b):
        if b == 0:
            return a
        return Math.gcd(b,a % b)
    def lcm(a,b):
        return (a * b) // Math.gcd(a,b)
    def roundUp(a,b):
        return -(-a // b)
    def toUpperMultiple(a,x):
        return Math.roundUp(a,x) * x
    def toLowerMultiple(a,x):
        return (a // x) * x
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret
    def isPrime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3,d + 1,2):
            if n % i == 0:
                return False
        return True

MOD = int(1e09) + 7

def main():
    N = Scanner.int()
    A = Scanner.map_int()
    if N == 1:
        print(A[0])
        return
    B = [0] * N
    i = 0
    j = N - 1 - N % 2
    for i in range(N // 2):
        B[i] = A[j]
        j -= 2
    i += 1
    B[i] = A[0]
    j = 2
    for i in range(i + 1,N):
        B[i] = A[j]
        j += 2
    if N % 2 == 1:
        B.reverse()
    print(*B)
    return

if __name__ == "__main__":
    main()

Solution (Python):
from sys import stdin

N = int(stdin.readline().rstrip())
A = stdin.readline().rstrip().split()

B = A[::-1]

ans = []

if N % 2 == 0:
  for i in range(0,N,2):
    ans += [B[i]]
  for i in range(0,N,2):
    ans += [A[i]]
  
else:
  for i in range(0,N,2):
    ans += [B[i]]
  for i in range(1,N,2):
    ans += [A[i]]

print(*list(ans))

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

Solution (Python):
from collections import deque

n = int(input())
A = [int(a) for a in input().split()]

B = deque()
for i in range(n):
    if n%2 == 0:
        if i%2 == 0:
            B.append(A[i])
        else:
            B.appendleft(A[i])
    else:
        if i%2 == 0:
            B.appendleft(A[i])
        else:
            B.append(A[i])
        
B = list(B)
print(*B)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from collections import deque

N,*A = map(int,read().split())

B = deque()
reverse = False
for x in A:
    if reverse:
        B.appendleft(x)
    else:
        B.append(x)
    reverse = not reverse

B = list(B)
if reverse:
    B = B[::-1]

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

Solution (Python):
N=int(input())

A=list(map(int,input().split()))
B=[]
C=[]

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

C.reverse()
for i in range(len(B)):
    C.append(B[i])

for i in range(N):
    print(C[i] if i==0 else " "+str(C[i]),end="")
print()

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
b=[]
b2=[]
if N%2==0:
  for i in range(0,N,2):
    b.append(str(a[N-i-1]))
    b2.append(str(a[i]))
  ans=b+b2
else:
  for i in range(N):
    if i%2==0:
      b.append(str(a[N-1-i]))
    else:
      b2.append(str(a[i]))
  ans=b+b2
print(' '.join(ans))

Solution (Python):
n = int(input())
*a, = map(int, input().split())

b = list(reversed(a[1::2]))+a[0::2]
print(" ".join(map(str, b if n%2 == 0 else reversed(b))))

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import deque
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math
from collections import deque

class SegTree():
    def __init__(self, n):
        self.value = [0 for i in range(n*2)]



def main():
    n = getN()
    nums = getList()
    d = deque()
    for i, num in enumerate(nums):
        if i % 2 != n % 2:
            d.appendleft(num)
        else:
            d.append(num)


    print(*d)

if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
if n%2==0:
  print(*a[1::2][::-1]+a[0::2])
else:
  print(*a[0::2][::-1]+a[1::2])

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    
    N = int(input())
    A = list(map(int,input().split()))
    
    
    
    from collections import deque
    que = deque()
    for i in range(N):
        if i%2==0:
            que.append(A[i])
        else:
            que.appendleft(A[i])
    
    if N%2==0:
        print(*list(que))
    else:
        print(*((list(que))[::-1]))
    
main()

Solution (Python):
from collections import deque

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

q = deque()
for i in range(N):
  a = A[i]
  if i > 1 and i % 2 == 0:
    q.appendleft(a)
  else:
    q.append(a)

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

Solution (Python):
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    ls = collections.deque()
    for i, v in enumerate(a):
        if i % 2 == n % 2:
            ls.append(v)
        else:
            ls.appendleft(v)
    print(*ls)


if __name__ == '__main__':
    slove()

Solution (Python):
n = int(input())
s = list(map(int, input().split()))
t = []
if n % 2 == 0:
    for i in range(n // 2):
        t.append(s[-(i * 2 + 1)])
    for i in range(n // 2):
        t.append(s[i * 2])
else:
    for i in range(n // 2 + 1):
        t.append(s[-(i * 2 + 1)])
    for i in range(n // 2):
        t.append(s[i * 2 + 1])
print(*t)

Solution (Python):
n = int(input())
s = list(map(int, input().split()))
t = []
if n % 2 == 0:
    for i in range(n // 2):
        t.append(s[-(i * 2 + 1)])
    for i in range(n // 2):
        t.append(s[i * 2])
else:
    for i in range(n // 2 + 1):
        t.append(s[-(i * 2 + 1)])
    for i in range(n // 2):
        t.append(s[i * 2 + 1])
r = ''
for n in t:
    r += str(n) + ' '
print(r)

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    ls = []
    for i in range(n-1, -1, -2):
        ls.append(a[i])
    for i in range(0 if n % 2 == 0 else 1, n, 2):
        ls.append(a[i])
    print(*ls)


if __name__ == '__main__':
    slove()

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]

a_odd = a[0::2]
a_even = a[1::2]

if n % 2 == 0:
    a_even.reverse()
    b = a_even + a_odd 
else:
    a_odd.reverse()
    b = a_odd + a_even

print(*b)

Solution (Python):
from collections import deque


que = deque()

n = int(input())
seq = list(map(int, input().split()))

for i in range(n):
    if i%2 == 0:
        que.append(seq[i])
    else:
        que.appendleft(seq[i])

if n%2 != 0:
    que.reverse()



print(*que)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a1=[]
for i in range(n-1,-1,-2):
    a1.append(a[i])
a2=[]
for i in range(n-2,-1,-2):
    a2.append(a[i])
a2.reverse()
a1+=a2
print(*a1)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))

ans = []
for i in range(N - 1, -1, -2):
    ans.append(a[i])
    
tmp_ans = []
for i in range(N - 2, -1, -2):
    tmp_ans.append(a[i])
tmp_ans.reverse()
ans += tmp_ans 
print(" ".join(map(str, ans)))

Solution (Python):
n=int(input())
m=n
a=list(map(int,input().split()))
if(m%2==0):
  while(n>=4):
    print(str(a[n-1])+' ',end="")
    n-=2
  print(str(a[1])+' ',end="")
  n=1
  while(n!=m-1):
    print(str(a[n-1])+' ',end="")
    n+=2
  print(a[m-2])
else:
  if(m==1):
    print(a[0])
  else:
    while(n>=3):
      print(str(a[n-1])+' ',end="")
      n-=2
    print(str(a[0])+' ',end="")
    n=2
    while(n!=m-1):
      print(str(a[n-1])+' ',end="")
      n+=2
    print(a[m-2])

Solution (Python):


import sys
import math

n=int(input())

tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))


ans=[]
if(n%2==0):
	for i in range(0,n//2):
		ans.append(hoge[n-i*2-1])
	for i in range(0,n//2):
		ans.append(hoge[i*2])
else:
	for i in range(0,n//2+1):
		ans.append(hoge[n-i*2-1])
	for i in range(0,n//2):
		ans.append(hoge[i*2+1])
	

ret=""
ret+=str(ans[0])
for i in range(1,n):
	ret+=" "
	ret+=str(ans[i])
print(ret)

Solution (Python):
N = int(input())
A = list(input().split())

l = []
r = []
flag = False
if N % 2 == 0:
    for i in range(N-1, 0, -2):
        if flag:
            print(" ", end="")
        print(A[i], end="")
        flag = True
    for i in range(0, N, 2):
        if flag:
            print(" ", end="")
        print(A[i], end="")
else:
    for i in range(N-1, -1, -2):
        if flag:
            print(" ", end="")
        print(A[i], end="")
        flag = True
    for i in range(1, N, 2):
        if flag:
            print(" ", end="")
        print(A[i], end="")


print()

Solution (Python):


from collections import deque

n = int(input())
a = list(map(int, input().split()))
que = deque()

for i in range(n):
    if i % 2 == 0:
        que.append(a[i])
    else:
        que.appendleft(a[i])
        
if len(que) % 2 != 0:
    for j in range(n):
        print(que.pop(), end = " ")
else:
    for k in range(n):
        print(que.popleft(), end = " ")

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
print(*(a[-1::-2]+a[n%2::2]))

Solution (Python):
from collections import deque
N=int(input())
A=list(map(int,input().strip().split(' ')))
q=deque([])
for i in range(len(A)):
    if i%2==0:
        q+=[A[i]]
    else:
        q.appendleft(A[i])
ans=0
if (len(A)-1)%2==1:
    ans=(list(q))
else:
    ans=(list(q)[::-1])
ans=[str(x) for x in ans]
print(" ".join(ans))

Solution (Python):
from collections import deque
n = int(input())
alist = deque(map(int, input().split()))

blist = deque([])
for i in range(n) :
    bi = alist.popleft()
    if (n^i)&1 == 1 :
        blist.appendleft(bi)
    else :
        blist.append(bi)

for b in blist :
    print(b, end=" ")

Solution (Python):
n = int(input())
a = list(map(int,input().split()))

from collections import deque

Q=deque([])

if n%2==0:
    for i in range(n):
        if i%2==0:
            Q.append(a[i])
        else:
            Q.appendleft(a[i])
else:
    for i in range(n):
        if i%2==0:
            Q.appendleft(a[i])
        else:
            Q.append(a[i])

ans = []

for i in range(n):
    ans.append(Q.popleft())

print(*ans)

Solution (Python):

from collections import deque


def main():
    n = int(input())
    lst = list(map(int, input().rstrip().split()))
    b = deque()
    parity = n % 2
    for i, j in enumerate(lst, start=1):
        if i % 2 == parity:
            b.appendleft(j)
        else:
            b.append(j)
    print(*b)


if __name__ == "__main__":
    main()

Solution (Python):
from collections import deque

N = int(input())
*A, = map(int, input().split())
B = deque([])
for i, a in enumerate(A):
    if i % 2 == 0:
        B.append(a)
    else:
        B.appendleft(a)
if N % 2 == 1:
    B = list(reversed(B))
print(*B)

Solution (Python):

from collections import deque

n = int(input())
lst = list(map(int, input().rstrip().split()))
b = deque()
parity = n % 2
for i, j in enumerate(lst, start=1):
    if i % 2 == parity:
        b.appendleft(j)
    else:
        b.append(j)
print(*b)

Solution (Python):
from collections import deque
N = int(input())
line = input().split()
Q = deque([])

flag = 0 if (N % 2 != 0) else 1
for i in range(N):
    if (i % 2 == 0):
        if (flag):
            Q.append(line[i])
        else:
            Q.appendleft(line[i])
    else:
        if (flag):
            Q.appendleft(line[i])
        else:
            Q.append(line[i])

print(' '.join(Q))

Solution (Python):
from collections import deque

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

b = deque()
for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
if n % 2 == 1:
    b.reverse()

print(' '.join(b))

Solution (Python):
from collections import deque

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

dq = deque()
for i in range(n):
    if i % 2 == 0:
        dq.append(A[i])
    else:
        dq.appendleft(A[i])

ans = list(dq)
if n % 2 == 1:
    ans.reverse()
print(*ans)

Solution (Python):
from collections import deque

n = int(input())
a = [ int(x) for x in input().split() ]

q = deque([])
for key, value in enumerate(a):
    if key & 1 == n & 1:
        q.append(value)
    else:
        q.appendleft(value)

print(*q)

Solution (Python):
from collections import deque
n = int(input())
A = list(map(int,input().split()))

b = deque()
for i,a in enumerate(A):
    if i % 2 == 0:
        b.append(a)
    elif i % 2 == 1:
        b.appendleft(a)

if n % 2 == 1:
    b.reverse()
print(*b)

Solution (Python):
n = int(input())
A = list(input().split())

even = [A[i] for i in range(n) if i % 2 == 0]
odd = [A[i] for i in range(n) if i % 2 == 1]

if n % 2 == 0:
    print(' '.join(list(reversed(odd)) + even))
else:
    print(' '.join(list(reversed(even)) + odd))

Solution (Python):
N=int(input())
A=list(map(str, input().split(' ')))
even=A[0::2]
odd=A[1::2]
print(' '.join(even[::-1])+' '+' '.join(odd)) if N%2==1 else print(' '.join(odd[::-1])+' '+' '.join(even))

Solution (Python):
n = int(input())
As= list(map(int,input().split()))
back = As[::-2]
if n%2==0:
    forward = As[::2]
else:
    forward = As[1::2]
ans = back+forward
print(" ".join(map(str,ans)))

Solution (Python):
N = int(input())
A = [int(a) for a in input().split()]

print(*([A[i] for i in range(N-1,-1,-2)]+[A[i] for i in range(N%2,N,2)]))

Solution (Python):
n = int(input())
a = [int(_) for _ in input().split()]

if n%2==0:
    s = a[n-1::-2] + a[::2]
else:
    s = a[n-1::-2] + a[1::2]

print(*s)

Solution (Python):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**9)
n=int(input())
A=list(map(int,input().split()))
B=[]
if n%2:
    for i in range(n-1,-1,-2):
        B.append(A[i])
    for i in range(1,n-1,2):
        B.append(A[i])
else:
    for i in range(n-1,0,-2):
        B.append(A[i])
    for i in range(0,n-1,2):
        B.append(A[i])
print(*B,sep=' ')

Solution (Python):
from collections import deque
n = input()
a = map(int, raw_input().split())

res = deque()

for i in range(n):
  if i % 2 == 0:
    res.appendleft(a[i])
  else:
    res.append(a[i])
if n % 2 == 0:
  print ' '.join(map(str, reversed(res)))
else:
  print ' '.join(map(str, res))

Solution (Python):
from collections import deque
n = input()
a = map(int, raw_input().split())

res = deque()

for i in range(n):
  if i % 2 == 0:
    res.appendleft(a[i])
  else:
    res.append(a[i])
if n % 2 == 0:
  print ' '.join(map(str, reversed(res)))
else:
  print ' '.join(map(str, res))

Solution (Python):
n=int(input())
a=list(map(str,input().split()))
if n%2!=1:
    s=list(reversed(a[1::2]))+a[::2]
else:
    s=list(reversed(a[::2]))+a[1::2]
c=""
for i in range(n):
    c+=s[i]+" "
print(c)

Solution (Python):


"""
Created on Sun Feb 10 10:05:08 2019

@author: shinjisu
"""



def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def dmp(x):
    global debug
    if debug:
        print(x)


def probC_TLE():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    b = []
    for i in range(N):
        b.append(A[i])
        b.reverse()
        dmp(b)
    return b


def probC_TLE2():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    former, latter = [], []
    for i in range(-1, -N-1, -1):
        if i % 2 == 0:
            latter = [A[i]] + latter
        else:
            former.append(A[i])
        full = former + latter
        dmp((former, latter, full))
    return full


def probC_TLE3():
    N = getInt()
    A = [x for x in input().split()]
    dmp((N, A))
    former, latter = '', ''
    for i in range(-1, -N-1, -1):
        if i % 2 == 0:
            latter = A[i] + ' ' + latter
        else:
            former = former + ' ' + A[i]
        dmp((former, latter))
    return former[1:] + ' ' + latter


def probC():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    b = zeros(N)
    for i in range(-1, -N-1, -1):
        if i % 2 == 0:
            b[i//2] = A[i]
        else:
            b[-i//2] = A[i]
        dmp(b)
    return b


debug = False

for n in probC():
    print(n, end=' ', flush=True)

Solution (Python):
INF, MOD = float("inf"), 1e9 + 7
MAX, MIN = -INF, INF
dx1, dy1, dx2, dy2 = [-1, 0, 1, 0], [0, -1, 0, 1], [-1, 0, 1, -1, 1, -1, 0, 1], [-1, -1, -1, 0, 0, 1, 1, 1]

def get_int():
    return int(input())

def get_int_list():
    return list(map(int, input().split()))

def mins(x, y):
    x = min(x, y)

def maxs(x, y):
    x = max(x, y)

while(True):
    try:
        n = get_int()
        a = get_int_list()
        print(*(a[::-2] + a[1::2]) if n % 2 else a[::-2] + a[::2])
    except EOFError:
        exit()

Solution (Python):
N = int(input())
A = list(input().split())

ans = []

l1 = A[0::2]
l2 = A[1::2]
if N % 2 == 0:
    l2 = l2[::-1]
    ans = l2+l1
else:
    l1 = l1[::-1]
    ans = l1+l2

print(" ".join(ans))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

ans = []

l1 = A[0::2]
l2 = A[1::2]
if N % 2 == 0:
    l2 = l2[::-1]
    ans = l2+l1
else:
    l1 = l1[::-1]
    ans = l1+l2

print(" ".join(list(map(str, ans))))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

ans = []
if N % 2 == 0:
    l1 = A[0::2]
    l2 = A[1::2]
    l2 = l2[::-1]
    ans = l2+l1
else:
    l1 = A[0::2]
    l2 = A[1::2]
    l1 = l1[::-1]
    ans = l1+l2

print(" ".join(list(map(str, ans))))

Solution (Python):
n = int(input())
a = list(int(i) for i in input().split())
aodd = []
aeven = []
for i in range(n):
 if i%2 == 1: aodd.append(a[i])
 else: aeven.append(a[i])
ans = []
if n%2 == 0:
  aeven.reverse()
  ans = aeven + aodd
else:
  aodd.reverse()
  ans = aodd+ aeven
ans.reverse()
  
print(*ans)

Solution (Python):
n = int(input())
A = input().split(' ')

if n == 1:
    ans = A[0]
    print(ans)
    exit()
else:
    A_odd = A[::2]
    A_even = A[1::2]
    if n % 2 == 0:
        ans = A_even[::-1] + A_odd
    else:
        ans = A_odd[::-1] + A_even
    print(' '.join(ans))

Solution (Python):
a = int(input())
ar = list(map(int,input().split(" ")))
br = []
if a % 2 == 0:
    for i in range(len(ar)-1,0,-2):
        br.append(ar[i])
    for i in range(0,len(ar)-1,+2):
        br.append(ar[i])
else:
    for i in range(len(ar)-1,-1,-2):
        br.append(ar[i])
    for i in range(1,len(ar)-1,+2):
        br.append(ar[i])
for i in range(a-1):
    print(str(br[i]),end = " ")
print(str(br[a-1]))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

if N % 2:
    index = list(range(N - 1, -1, -2)) + list(range(1, N, 2))
else:
    index = list(range(N - 1, 0, -2)) + list(range(0, N, 2))

print(*list(map(lambda i: A[i], index)))

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
B=[0 for i in range(N)]
if N%2==0:
    for i in range(N):
        B[N//2+(i//2+i%2)*((-1)**i)]=A[i]
else:
    for i in range(N):
        B[N//2+(i//2+i%2)*((-1)**(i+1))]=A[i]
for j in range(N):
    print(B[j], end=' ')
print()

Solution (Python):
def inpl(): return [int(i) for i in input().split()]
n = int(input())
a = inpl()
ans = [0 for _ in range(n)]
if n%2:
    for i,ai in enumerate(a):
        if i%2:
            ans[n//2+(i+1)//2] = ai
        else:
            ans[n//2-(i+1)//2] = ai
else:
    for i,ai in enumerate(a):
        if i%2:
            ans[n//2-(i+1)//2] = ai
        else:
            ans[n//2+(i+1)//2] = ai
print(*ans)

Solution (Python):
from collections import deque
n=int(input().strip())
a=list(map(int, input().split()))
b = deque()
for i in range(n):
    if i%2==0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
b=list(b)
if n%2==1:
    b=b[::-1]
print(' '.join(map(str, b)))

Solution (Python):

import sys
import collections
import math
from collections import Counter
from collections import deque

n = int(input())
A = [int(x) for x in input().split()]

Q = deque()

f = True
if n % 2 == 0:
    f = not f

for a in A:
    if f:
        Q.appendleft(a)
    else:
        Q.append(a)
    f = not f

print(" ".join([str(q) for q in Q]))

sys.exit(0)

Solution (Python):
import sys
import collections
import math

n = int(input())
A = [int(x) for x in input().split()]

R = [0] * n

idx = 0
for i in range(n-1, -1, -2):
    R[idx] = A[i]
    idx += 1

for i in range(n % 2, n, +2):
    R[idx] = A[i]
    idx += 1

print(" ".join([str(i) for i in R]))

sys.exit(0)

Solution (Python):
f = lambda: list(map(int,input().split()))
n = int(input())
a = f()
if n&1:
    b = a[::-2]+a[1::2]
else:
    b = a[::-2]+a[::2]
print(*b)

Solution (Python):
from collections import deque
N=int(input())
A=[i for i in input().split()]
s=deque()
s.append(A[0])
if N%2==1:
    for i in range(1,N):
        if i%2==1:
            s.append(A[i])
        else:
            s.appendleft(A[i])
else:
    for i in range(1,N):
        if i%2==0:
            s.append(A[i])
        else:
            s.appendleft(A[i])
print(' '.join(map(str,s)))

Solution (Python):

n = int(input())
a = list(map(int,input().split()))
c = []
d = []

for i in range(n):
    if i %2 == 0:
        c.append(a[i])
    else:
        d.append(a[i])
c = c[::-1]

b = c + d
c = b[::-1]
ass = ''
for i in range(n):
    if n %2 == 0:
        ass += str(c[i]) + ' '
    else:
        ass += str(b[i]) + ' '
print(ass)

Solution (Python):
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import *
from heapq import *

def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

N = read()
A = reads()

ls = deque()
rev = False

for a in A:
  if rev:
    ls.appendleft(a)
  else:
    ls.append(a)
  rev = not rev

if rev:
  ls.reverse()

print(" ".join(str(x) for x in ls))