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):
from collections import deque
n = int(input())
a = [int(x) for x in 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 != 0:
    b.reverse()

b = list(b)

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

Solution (Python):
from collections import deque


N = int(input())
A = list(map(int, input().split()))
q = deque()
for i, a in enumerate(A):
    if i % 2 == 0:
        q.append(a)
    else:
        q.appendleft(a)

ans = []
if len(A) % 2 == 1:
    while q:
        ans.append(q.pop())
else:
    while q:
        ans.append(q.popleft())

print(*ans)

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

b = collections.deque()

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

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
from collections import deque

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

n = i_i()
a = i_l()

d = deque()

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

if n % 2 == 0:
    print(*list(reversed(d)))
else:
    print(*d)

Solution (Python):
def main():
    n = int(input())
    data = list(map(int, input().split()))

    if n == 1:
        print(data[0])
    else:
        result = [None] * n

        if n % 2 == 0:
            center = int(n / 2)
            for index, value in enumerate(data):
                if index % 2 == 0:
                    result[center + int(index / 2)] = value
                else:
                    result[center - int((index + 1) / 2)] = value
            print(" ".join(str(n) for n in result))
        else:
            center = int(n / 2)
            for index, value in enumerate(data):
                if index % 2 == 0:
                    result[center - int(index / 2)] = value
                else:
                    result[center + int((index + 1) / 2)] = value
            print(" ".join(str(n) for n in result))

if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np
from collections import deque
n = int(input())
a_ls = list(map(int, input().split()))
q = deque(a_ls)

if n != 1:
    l_ls = [0] * int(np.floor(0.5*n))
    r_ls = [0] * max(0,(n-1)//2)
    first = q.popleft()
    count = 2
    while True:
        a = q.popleft()
        if count % 2 == 0:
            l_ls[count//2-1] = a
        else:
            r_ls[count//2-1] = a
        count += 1
        if count > n:
            break
    ans = []
    if n % 2 ==0:
        for i in range(len(l_ls)):
            l = l_ls.pop()
            ans.append(l)
        ans.append(first)
        for i in range(len(r_ls)):
            ans.append(r_ls[i])
    else:
        for i in range(len(r_ls)):
            l = r_ls.pop()
            ans.append(l)
        ans.append(first)
        for i in range(len(l_ls)):
            ans.append(l_ls[i])

    ans = [str(b) for b in ans]
    print(' '.join(ans))

else:
    print(a_ls[0])

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

bl=[]
br=[]
if n%2==0:
    for i in range(0,n-1,2):
        bl.append(a[i]) 
        br.append(a[i+1]) 
    br.reverse()
    br=br+bl
else:
    for i in range(0,n-2,2):
        bl.append(a[i]) 
        br.append(a[i+1]) 
    bl.append(a[n-1]) 
    bl.reverse()
    br=bl+br
    
for i in range(len(br)):
    print(br[i],end=" ")
print()

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

if n%2 == 0:
    inds = list(range(n-1,0,-2)) + list(range(0,n,2))
else:
    inds = list(range(n-1,-1,-2)) + list(range(1,n,2)) 

Bs = [As[i] for i in inds]
print(*Bs)

Solution (Python):
from collections import deque

def main():
    n = int(input())
    a = list(map(int, input().split()))
    r = deque()
    for ia in range(n):
        if ia % 2 == 1:
            r.appendleft(a[ia])
        else:
            r.append(a[ia])

    if n % 2 == 1:
        r.reverse()
    for i in range(n):
        print(r[i], end = ' ')



if __name__ == '__main__':
    main()

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

from collections import deque
b = deque([])
if len(a) % 2 == 0:
    for i in range(1, N + 1):
        
        if i % 2 == 0:
            b.appendleft(a[i - 1])
        else:
            b.append(a[i - 1])
else:
    for i in range(1, N + 1):
        
        if i % 2 == 0:
            b.append(a[i - 1])
        else:
            b.appendleft(a[i - 1])

print(' '.join([str(i) for i in b]))

Solution (Python):


import collections


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

    result = collections.deque()

    for i in range(N):
        if i % 2 == N % 2:
            result.append(A[i])
        else:
            result.appendleft(A[i])
    print(*result)


if __name__ == "__main__":
    main()

Solution (Python):
from collections import deque
n = int(input())
l = input().split()
d = deque()
for idx, i in enumerate(l):
    if (idx +1) % 2 == 1:
        d.appendleft(i)
    else:
        d.append(i)
if n % 2 == 0:
    d.reverse()
print(' '.join(d))

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

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

for i in range(n):
    print(d.popleft(),end=' ')

Solution (Python):
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

from collections import deque

n = ni()
a = na()

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

if n % 2 == 0:
    for i in range(n):
        if i:
            print(" ", end="")
        print(q.popleft(), end="")
    print()
else:
    for i in range(n):
        if i:
            print(" ", end="")
        print(q.pop(), end="")
    print()

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:
        b.appendleft(a[i])
    else:
        b.append(a[i])

o = b.pop if n%2 else b.popleft

for i in range(n):
    print(o(), end=' ')

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

d = deque()
e=[]
for i in range (x):
	if i%2==0:
		d.append(y[i])
	else:
		d.appendleft(y[i])
if i%2==0:
	for i in range(x):
		e.append(d[((-i)-1)])
	print(*(list(e)))
else:
	print(*(list(d)))

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

if n % 2 == 0:
    for i in range(n-1, 0, -2):
        print(a[i], end=' ')
    for i in range(0, n-1, 2):
        print(a[i], end=' ')
else:
    for i in range(n - 1, -1, -2):
        print(a[i], end=' ')
    for i in range(1, n - 1, 2):
        print(a[i], end=' ')

Solution (Python):
n = int(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()
    print(*b2+b1)
else:
    b1.reverse()
    print(*b1+b2)

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

ans=[]
if n%2==0:
    num=n+2
    for i in range(n):
        if num==2:
            num=1
            ans.append(a[0])
        elif num%2==0:
            num-=2
            ans.append(a[num-1])
        else:
            num+=2
            ans.append(a[num-1])
else:
    num=n
    for i in range(n):
        if num==1:
            ans.append(a[0])
            num=2
        elif num%2!=0:
            ans.append(a[num-1])
            num-=2
        else:
            ans.append(a[num-1])
            num+=2
print(*ans)

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007



def main():
	n=int(input())
	s = list(IN())
	s_odd=s[1::2]
	s_even=s[::2]
	if len(s)%2==1:
		s_even=s_even[::-1]
		ret = s_even+s_odd
	else:
		s_odd=s_odd[::-1]
		ret = s_odd+s_even
	print(*ret)
	
	
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

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

    reverse = False
    for i in range(n):
        if not reverse:
            d.append(A[i])
            reverse = not reverse
        else:
            d.appendleft(A[i])
            reverse = not reverse

    if not reverse:
        for i in d:
            print(i, end=' ')
    else:
        for i in reversed(d):
            print(i, end=' ')


resolve()

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

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

mae = []
naka = [t[0]]
usiro = []

for i in range(1,n):
    if i%2==1:
        mae.append(t[i])
    else:
        usiro.append(t[i])

if n%2==0:
    mae.reverse()
    ans = mae+naka+usiro
else:
    usiro.reverse()
    ans = usiro+naka+mae
print(' '.join(map(str,ans)))

Solution (Python):
input()
from collections import *
d=deque()
s=1
for i in map(int,input().split()):
  if s>0: d.append(i)
  else: d.appendleft(i)
  s*=-1
print(*list(d)[::s])

Solution (Python):
N = int(input())
Ai = input().split()
if N != 1:
  if N%2==0:
    b = Ai[::-2] + Ai[::2]
  else:
    b = Ai[-2::-2] + Ai[::2]
    b = b[::-1]
else:
  b = Ai
print(*[bb for bb in b], sep=" ")

Solution (Python):
n=int(input());l=input().split();print(*l[::-2]+l[n%2::2])

Solution (Python):
n=int(input());l=list(input().split());print(*l[n-n%2::-2]+l[n%2::2])

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

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

if n%2==0:
    odd = list(range(1, n, 2))
    eve = list(reversed(list(range(2, n+1, 2))))
    ix = eve+odd
    for i in ix:
        print(a[i-1], end=' ')

else:
    odd = list(reversed(list(range(1, n+1, 2))))
    eve = list(range(2, n, 2))
    ix = odd+eve
    for i in ix:
        print(a[i-1], end=' ')

print()

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

ans = list(reversed(a[1::2])) + a[::2]
if n % 2:
    print(*reversed(ans))
else:
    print(*ans)

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

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

from collections import deque

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

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

Solution (Python):
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
a1 = []
a2 = []
for i in range(n):
    if i % 2 == 0:
        a1.append(a[i])
    else:
        a2.append(a[i])
if n % 2 == 0:
    a2.reverse()
    print(*a2+a1)
else:
    a1.reverse()
    print(*a1+a2)

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

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

Solution (Python):

import math
import heapq
import bisect
import numpy as np
from collections import Counter


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

ans = A[N-1::-2] + A[N%2::2]

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

Solution (Python):
from collections import deque

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

b = deque()
for i, k in enumerate(a):
    b.append(k) if i % 2 == 0 else b.appendleft(k)

print(' '.join(map(str, b))) if n % 2 == 0 else print(' '.join(map(str, reversed(b))))

Solution (Python):
from collections import deque


def solve():
    n = int(input())
    a = list(map(int, input().split()))
    
    ans = deque([])
    for i in range(n):
        if i % 2 == 0:
            ans.append(a[i])
        else:
            ans.appendleft(a[i])
    if n % 2 == 1:
        ans.reverse()
    print(' '.join(map(str, ans)))


if __name__ == '__main__':
    solve()

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

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

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

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

odd, even = [], []

for i in range(n):
    if (i + 1) % 2 ==1:
        odd += [l[i]]
    else:
        even += [l[i]]

even.reverse()
e_o = even + odd

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

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

left = []
right = []

for i in range(n):
    if i % 2 == 0:
        right.append(al[i])
    else:
        left.append(al[i])

if n % 2 == 0:
    ans = left[::-1] + right
else:
    ans = right[::-1] + left

print(*ans, sep=' ')

Solution (Python):
N, *A = map(int, open(0).read().split())

od = A[::2]
ev = A[1::2]

if N & 1:
  ans = od[::-1]+ev
else:
  ans = ev[::-1]+od
  
print(" ".join([str(a) for a in ans]))

Solution (Python):
from collections import deque
n = int(input())
a = [int(x) for x in input().split()]
b = deque()

rev = False

for i in range(n):
    if not rev:
        b.append(a[i])
    else:
        b.appendleft(a[i])
    rev = not rev

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

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
ar = list(reversed(a))
b = []
c = []

if len(a)%2 == 0:
    for i in range(len(a)//2):
        b.append(ar[i*2])
        c.append(a[i*2])
else:
    for i in range(-(-(len(a))//2)):
        if i == len(a)//2:
            b.append(ar[(i*2)])
        else:
            b.append(ar[i*2])
            c.append(a[(i*2)+1])

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

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

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

Solution (Python):
N = int(input())
points = list(map(int, input().split()))
even_points = [points[index] for index in range(len(points)) if index % 2 == 0]
odd_points = [points[index] for index in range(len(points)) if index % 2 == 1]

if N % 2 == 0:
  odd_points = list(reversed(odd_points))
  odd_points.extend(even_points)
  ans = odd_points
else:
  even_points = list(reversed(even_points))
  even_points.extend(odd_points)
  ans = even_points

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

Solution (Python):
from collections import deque
n = int(input())
a = [int(x) for x in input().split()]
d = deque()
is_rev = False
for i in a:
    if is_rev:
        d.appendleft(i)
    else:
        d.append(i)
    is_rev = not is_rev
if is_rev:
    d = list(d)[::-1]
print(*d)

Solution (Python):
from collections import deque

n = int(input())
aa = list(map(int, input().split()))
bb = deque()
left = True
for a in aa:
    if left:
        bb.append(a)
    else:
        bb.appendleft(a)
    left = not left

if not left:
    bb.reverse()
print(*list(bb))

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





n=ii()
arr=deque(limii())
b=deque([])
for i in range(n):
    if i%2==1:
        x=arr.popleft()
        b.appendleft(str(x))

    else:
        x=arr.popleft()
        b.append(str(x))
if n%2==0:
    print(" ".join(list(b)))
else:
    print(" ".join(list(reversed(list(b)))))

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
b = [-1 for i in range(n)]
if n%2==1:
  left = n//2+1
  right = left - 2
  center = left - 1
  b[center] = a[0]
  
  for i in range(1,n):
    if i%2==1:
      b[left]=a[i]
      left+=1
    else:
      b[right]=a[i]
      right-=1
          
else:
  left = n//2
  right = left-1
  for i in range(n):
    if i%2==1:
      b[right]=a[i]
      right-=1
    else:
      b[left]=a[i]
      left+=1
    
ans=""
for i in range(n):
  ans+=str(b[i])+" "
print(ans)

Solution (Python):
from collections import deque

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

b=deque()
for i in range(n):
    if (i+n)%2!=0:
        b.appendleft(a[i])
    else:
        b.append(a[i])
print(*b)

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

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

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

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
left = []
right = []
for i in range(n):
  right.append(str(a[i]))
  left,right = right,left
left.reverse()
print(" ".join(left+right))

Solution (Python):
import os
import sys
from collections import deque

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))

que = deque()
for i in range(N):
    if i % 2 == 0:
        que.append(A[i])
    else:
        que.appendleft(A[i])
if N % 2:
    que.reverse()
print(*que)

Solution (Python):
n = int(input())
a = input().split()
b = []
for i in range(n - 1, -1, -2):
  b.extend([a[i]])
for j in range(n % 2, n, 2):
  b.extend([a[j]])
print(" ".join(b))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
res1 = []
res2 = []
if n % 2 == 1:
  res1.append(a.pop(-1))
  n = n -1
  for i in range(n//2):
    res1.append(a[n-2-2*i])
    res2.append(a[1+i*2])
  res1.extend(res2)
  print(*res1)
else:
  for i in range(n//2):
    res1.append(a[n-1-2*i])
    res2.append(a[i*2])
  res1.extend(res2)
  print(*res1)

Solution (Python):
n=int(input())
a=input().split()
numbers=[b for b in a]
n=len(numbers)
if n%2==0:
    kisuu=numbers[1::2]
    guusuu=numbers[0::2]
    kisuu.reverse()
    kotae=kisuu+guusuu
else:
    kisuu=numbers[1::2]
    guusuu=numbers[0::2]
    guusuu.reverse()
    kotae=guusuu+kisuu
answer=''
for z in kotae:
    answer+=str(z)
    answer+=' '
print(answer)

Solution (Python):
n=int(input())
a=input().split()
numbers=[b for b in a]
n=len(numbers)
if n%2==0:
    kisuu=numbers[1::2]
    guusuu=numbers[0::2]
    kisuu.reverse()
    kotae=kisuu+guusuu
else:
    kisuu=numbers[1::2]
    guusuu=numbers[0::2]
    guusuu.reverse()
    kotae=guusuu+kisuu
answer=''
for z in kotae:
    answer+=str(z)
    answer+=' '
print(answer)

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

for i in range(n):
    if (i + 1) % 2 == 0:
        ans.appendleft(s[i])
    else:
        ans.append(s[i])
if n % 2 == 1:
    ans.reverse()
ans = map(str, ans)
print(' '.join(ans))

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

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
s1 = []
s2 = []
for i in range(n):
  if i % 2 == 0:
    s1.append(a[i])
  else:
    s2.append(a[i])

if n % 2 == 0:
  for x in list(reversed(s2)) + s1:
    print(x, end=' ')
else:
  for x in list(reversed(s1)) + s2:
    print(x, end=' ')
print()

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

top = []
last = []
for i in range(n):
  if i % 2 == 0:
    top.append(a[i])
  else:
    last.append(a[i])
    
top.extend(reversed(last))

print(' '.join(top))

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

b = A[::2][::-1] + A[1::2]
if N % 2 == 0:
    b = b[::-1]
print(" ".join(b))

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

    deq = deque()
    for i in range(n):
        if i % 2 == 0:
            deq.append(a[i])
        else:
            deq.appendleft(a[i])
    
    ans = list(deq)
    if n % 2 == 0:
        print(*ans, sep=' ')
    else:
        print(*ans[::-1], sep=' ')

if __name__ == '__main__':
    solve()

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

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

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 ==0:
    print(*list(q))
else:
    print(*list(q)[::-1])

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

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

bl = [a[-2*i-1-n%2] for i in range(n//2)]
br = [a[2*i] for i in range((n+1)//2)]
b = bl + br
if n%2 == 0 :
    print(*b, sep=" ")
else :
    print(*b[::-1], sep=" ")

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],end=' ')
print(*A[N%2::2])

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])
    else:
        C.append(A[i])
if len(B) > len(C):
    ans = list(reversed(B)) + C
    print(*ans)
else:
    ans = list(reversed(C)) + B
    print(*ans)

Solution (Python):
from collections import deque

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


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

print(*b)

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

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

    for ii in range(0, n, 2):
        b.append(a[ii])

else:
    for j in range(n-1, -1, -2):
        b.append(a[j])

    for jj in range(1, n, 2):
        b.append(a[jj])

print(*b)

Solution (Python):
def main():
  n = int(input())
  a = list(input_list_str())
  index = n - 1
  ans = [a[index]]
  
  is_add = False
  for i in range(n-1):
    if is_add:
      index += 2
    else:
      index -= 2
    if index < 0:
      index = 0
      is_add = True
      
    ans.append(a[index])
    
    if index == 0 and is_add is False:
      index = -1
      is_add = True
    
      
  print(' '.join(ans))


def input_list():
  return map(int, input().split())

def input_list_str():
  return map(str, input().split())

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

import math
import fractions
from functools import reduce
main()

Solution (Python):
from collections import deque

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

ans = deque()

if n %2 == 0:
    for i in range(0,n):
        if i %2 != 0:
            ans.appendleft(a_L[i])
        else:
            ans.append(a_L[i])
else:
    for i in range(0,n):
        if i %2 == 0:
            ans.appendleft(a_L[i])
        else:
            ans.append(a_L[i])

print(*ans)

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

from collections import deque

ans = deque()

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

for i in range(N):
    print(ans[i],end=" ")

Solution (Python):
import sys
input = sys.stdin.readline

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

from collections import deque

def main():
    mod=10**9+7
    N=I()
    a=LI()
    ans=deque()
    for i in range(N):
        if i%2==1:
            ans.append(a[i])
        else:
            ans.appendleft(a[i])
    if N%2==0:
        ans.reverse()
    print(' '.join(map(str, ans)))
    

main()

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

if n % 2 == 1:
    for i in range(n - 1, -1, -2):
        print(a[i], end=" ")
    for i in range(1, n, 2):
        print(a[i], end=" ")
else:
    for i in range(n - 1, -1, -2):
        print(a[i], end=" ")
    for i in range(0, n, 2):
        print(a[i], end=" ")

Solution (Python):
def main():
    import sys
    
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    
    from itertools import combinations, permutations
    
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    

    

    n = int(input())
    a = input().split()
    b = []
    c = []
    if n%2==0:
        for i in range(n):
            if i%2:
                b.append(a[-i])
            else:
                c.append(a[i])
        print(' '.join(b+c))
    else:
        m = [a[-1]]
        a = a[:-1]
        n -= 1
        for i in range(n):
            if i%2:
                b.append(a[-i])
            else:
                c.append(a[i])
        print(' '.join((b+c+m)[::-1]))

if __name__ == '__main__':
    main()

Solution (Python):

from collections import deque


n = int(input().strip())
a_list = [int(i) for i in input().rstrip().split()]


dq = deque()

flag=1
for i in a_list:
    if flag == 1:
        dq.append(i)
    else:
        dq.appendleft(i)
    
    flag *= -1

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

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

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
odd = a[0::2]
even = a[1::2]
ans = []
if n%2 == 0:
	even.reverse()
	ans.extend(even)
	ans.extend(odd)
	print (*ans)
else:
	odd.reverse()
	ans.extend(odd)
	ans.extend(even)
	print (*ans)

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