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()))

b1 = []

b2 = []

for i in range(0,len(a),2):
    b1.append(a[i])
    
for i in range(1,len(a),2):
    b2.append(a[i])
    
if n%2 == 0:
    b2.reverse()
    b2.extend(b1)
    for i in b2:
        print(i,end = " ")
        
else:
    b1.reverse()
    b1.extend(b2)
    for i in b1:
        print(i,end = " ")

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
odd = []
even = []
ans = []

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

if n == 1:
    print(a[0])
    exit()
else:
    if n % 2 == 0:
        even.reverse()
        ans = even + odd
    else:
        odd.reverse()
        ans = odd + even

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

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

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

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

if n == 1:
    l = list(map(str,l))
    print(" ".join(l))
    exit()
2

ans = []

if n%2 == 0:
    tmp = n
    for j in range(n//2-1):
        ans.append(tmp)
        tmp -= 2
    ans.append(tmp)
    ans.append(1)
    tmp = 1
    for j in range(n//2-1):
        tmp += 2
        ans.append(tmp)
else:
    tmp = n
    for j in range(n//2):
        ans.append(tmp)
        tmp -= 2
    ans.append(tmp)
    tmp = 2
    for j in range(n//2):
        ans.append(tmp)
        tmp += 2

ans2 = [0]*n
cnt = 0
for i in ans:
    ans2[cnt] = str(l[i-1])
    cnt += 1


print(" ".join(ans2))

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

from collections import deque

d = deque()

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

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

for i in d:
    print(i,end=" ")
print()

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
b = [a[i] for i in range(n) if i % 2 == 0]
c = [a[i] for i in range(n) if i % 2 == 1]
if n % 2 == 0:
  d = c[::-1] + b
elif n % 2 == 1:
  d = b[::-1] + c
s = ' '.join([str(e) for e in d])
print(s)

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

b = [str(x) for x in b]
print(" ".join(b))

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.append(a[i])
    else:
        b.appendleft(a[i])
if n%2==0:
    print(*b)
else:
    print(*deque(reversed(b)))

Solution (Python):
from collections import deque

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

b = deque([])
b_rev = deque([])

for i in range(n):
    if i % 2 == 0:
        b.append(str(A[i]))
        b_rev.appendleft(str(A[i]))
    else:
        b.appendleft(str(A[i]))
        b_rev.append(str(A[i]))
    
if n % 2 == 0:
    print(' '.join(b))
else:
    print(' '.join(b_rev))

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

for i in range(n)[::-2]:
    o.append(a[i])


for i in range(n)[n%2::2]:
    o.append(a[i])
print(*o)

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
import sys

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

N = int(input())
A = inpl()

L = deque()

for i in range(N):
    if i%2:
        L.append(A[i])
    else:
        L.appendleft(A[i])

if (N%2):
    print(*L)
else:
    print(*list(L)[::-1])

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

for i in range(n)[::-2]:
    o.append(a[i])

for i in range(n)[n%2::2]:
    o.append(a[i])
print(*o)

Solution (Python):
from collections import deque

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

h = deque([])
for i in range(N):
  if i%2 == 0:
    h.append(As[i])
  else:
    h.appendleft(As[i])
    
if N%2 == 1:
  h.reverse()
  
print(" ".join(map(str,h)))

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(readline())
    a = list(map(int, readline().split()))

    odd = a[0::2]
    even = a[1::2]

    if n % 2 == 0:
        res = even[::-1] + odd
        print(*res)
    else:
        res = odd[::-1] + even
        print(*res)


if __name__ == '__main__':
    main()

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

from collections import deque

d = deque()
for i,num in enumerate(a):
    if i&1:
        d.appendleft(num)
    else:
        d.append(num)

if n&1:
    d.reverse()

print(*d)

Solution (Python):
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=' ')

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

l = []

if n == 1:
	print(*L)
	exit()

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

print(*l)

Solution (Python):
n = int(input())
a = list(input().split())
a1 = ['']*(n//2 + n%2)
a2 = ['']*(n//2)

for i in range(n):
	if i%2 == 0:
		a1[i//2] = a[i]
	else:
		a2[-i//2] = a[i]

if n%2 != 0 and n != 1:
	ans = ' '.join(a1[::-1]) + ' ' + ' '.join(a2[::-1])
elif n%2 == 0:
	ans = ' '.join(a2) + ' ' + ' '.join(a1)
else:
	ans = a[0]
print(ans)

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

Solution (Python):


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

guusuu = []
kisuu = []

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

ret = []
if N % 2 == 0:
    ret = kisuu[::-1] + guusuu
else:
    ret = guusuu[::-1] + kisuu

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

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,2):
        print(a[i],end=" ")
else:
    for i in range(n-1,-1,-2):
        print(a[i],end=" ")
    for i in range(1,n,2):
        print(a[i],end=" ")

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

print(*(a[::-2] + a[n%2::2]))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
ol = []
el = []

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

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

Solution (Python):
def main():
    n = int(input())
    A = [int(x) for x in input().split()]
    a0 = A.pop(0)
    ans = A[1:n:2][::-1] + [a0] + A[0:n:2]
    if n % 2 == 0:
        print(' '.join([str(a) for a in ans[::-1]]))
    else:
        print(' '.join([str(a) for a in ans]))

if __name__ == '__main__':
    main()

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

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

if (N % 2 == 0):
    FLAG = True
else:
    FLAG = False

even = A_s[1::2]
odd = A_s[0::2]
ans = []


if (FLAG):
    even = even[::-1]
    even.extend(odd)
    ans = even
    
else:
    odd = odd[::-1]
    odd.extend(even)
    ans = odd

ans = map(str, ans)

print(' '.join(ans))

Solution (Python):
from collections import deque

N=int(input())
d=deque()
S=list(map(int,input().split()))

revflag=False

for i in range(N):
    if revflag==False:
        d.append(S[i])
        revflag=True
    else:
        d.appendleft(S[i])
        revflag=False
    
if revflag==True:
    d.reverse()

Z=list(d)
Z=[str(a) for a in Z]
Z=" ".join(Z)
print(Z)

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

Solution (Python):
from collections import deque

def main():
    n = int(input())
    a = list(map(int, input().split()))
    b = deque([])
    for i, tmp in enumerate(a):
        if i%2 == 0:
            b.append(tmp)
        else:
            b.appendleft(tmp)
    if n%2 == 1:
        b.reverse()
    print(*b)

if __name__ == "__main__":
    main()

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

ans = [0] * n
a.reverse()
for i in range(n):
  if i % 2 == 0:
    ans[i//2] = a[i]
  else:
    ans[(n - 1) - (i//2)] = a[i]

print(*ans)

Solution (Python):
from collections import deque
N=int(input())
L=list(input().split())
R=deque()
for i in range(N):
  if i%2==0:
    R.appendleft(L[i])
  else:
    R.append(L[i])
if N%2==0:
  R=reversed(R)
R=list(R)
print(" ".join(R))

Solution (Python):
n = int(input())
a = list(input().split())
result = list(reversed(a))[::2]

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

print(*result)

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

Solution (Python):
from sys import stdin
from collections import deque
def main():
    
    readline=stdin.readline
    n=int(readline())
    a=list(map(int,readline().split()))

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

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

if __name__=="__main__":
    main()

Solution (Python):
n = input()
s = list(map(str,input().strip().split()))

from collections import deque

d = deque()

for i,_s in enumerate(s):
  if i % 2 == 0:
    d.appendleft(_s)
  else:
    d.append(_s)
if len(s) %2 != 0:
  print(" ".join(list(d)))
else:
  print(" ".join(list(deque(reversed(d)))))

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

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==0:
            b.append(a[i])
        else:
            b.appendleft(a[i])
else:
    for i in range(n):
        if i%2==0:
            b.appendleft(a[i])
        else:
            b.append(a[i])

print(*b)

Solution (Python):
from collections import deque

n = int(input())
a = input().split()
d = deque([])
for i in range(n):
    if i % 2 == 0:
        d.append(a[i])  
    else:
        d.appendleft(a[i])  
if (n % 2) == 1:
    print(' '.join(list(d)[::-1]))
else:
    print(' '.join(list(d)))

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.append(a[i])
    if i%2==1:
        b.appendleft(a[i])

if n%2==1:
    c=deque()
    for i in range(n):
        d=b.pop()
        c.append(d)
    print(*c)
else:
    print(*b)

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)
    else:
        B.appendleft(a)
if n % 2 == 1:
    B = list(B)[::-1]

print(*B)

Solution (Python):

N = int(input())
A = input().split()
from collections import deque

tmp = deque([])
for i,a in enumerate(A):
    if i %2!=0:
        tmp.appendleft(a)
    else:
        tmp.append(a)
if N%2!=0:
    tmp.reverse()
print(' '.join(tmp))

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

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

Solution (Python):
from collections import deque

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

d = deque()

for x in range(N):
    if x % 2 == 0:
        d.append(str(a[x]))
    else:
        d.appendleft(str(a[x]))
if N % 2 == 0:
    print(" ".join(d))
else:
    print(" ".join(reversed(d)))

Solution (Python):
from collections import deque 
n = int(input())

a = list(input().split())
b = []

q = deque()

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

    
print(" ".join(q))

Solution (Python):
from collections import deque 
n = int(input())

a = list(input().split())
b = []

q = deque()

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

    
print(" ".join(q))

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

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

e = []
o = []

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

if n%2 == 0:
    o = o[::-1]
    ans = o + e
    print(" ".join(ans))
else:
    e = e[::-1]
    ans = e + o
    print(" ".join(ans))

Solution (Python):
import numpy as np
n=int(input())
x=list(map(int,input().split()))
a=[]
b=[]
for i in range(n):
    if i%2==1:
        b.append(x.pop())
    if i%2==0:
        a.append(x.pop())
b=b[::-1]
print(*(a+b))

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

Solution (Python):
from collections import deque

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

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

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

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

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.append(a[i])
    else:
        b.appendleft(a[i])
if n%2==1:
    b.reverse()

print(*b)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7


n = INT()
a = LIST()
a_front = []
a_back = []
 
flg = 1
for i in range(n):
	if flg == 1:
		a_back.append(a[i])
	else:
		a_front.append(a[i])
	flg *= -1

ans = a_front[::-1] + a_back
if flg == 1:
	print(*ans)
else:
	print(*ans[::-1])

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

if n % 2 == 0:
    l = list(reversed(la))[::2]
    l = l + la[::2]
    print(" ".join(l))

else:
    l = list(reversed(la))[::2]
    l = l + la[1::2]
    print(" ".join(l))

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

if n%2 == 0:
  ans = [str(a[n-1-i*2]) for i in range(n//2)] + [str(a[j*2]) for j in range(n//2)]
else:
  ans = [str(a[n-1-i*2]) for i in range(n//2+1)] + [str(a[1+j*2]) for j in range(n//2)]

print(' '.join(ans))

Solution (Python):
from collections import deque

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])
    
ANS = list(ANS)
if N % 2 == 1:
  ANS = ANS[::-1]
  
print(" ".join(map(str,ANS)))

Solution (Python):
n = int(input())
A = list(input().split())
if n % 2:
    print(" ".join(A[::2][::-1]), " ".join(A[1::2]))
else:
    print(" ".join(A[1::2][::-1]), " ".join(A[::2]))

Solution (Python):
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *

from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction



mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]








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]))

Solution (Python):
from collections import deque

n = int(input())
as_ = map(int, input().strip().split())

d = deque()

reversed = False
for a in as_:
    if reversed:
        d.appendleft(a)
    else:
        d.append(a)
    reversed = not reversed

if reversed:
    d.reverse()

ans = ' '.join(map(str, d))

print(ans)

Solution (Python):
import sys
from collections import deque

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

res = deque()
t = (N + 1) % 2

for i in range(N):
    if i % 2 == t:
        res.appendleft(A[i])
    else:
        res.append(A[i])

print(*res)

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

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

Solution (Python):
import collections

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

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

B = ['_' for _ in range(N)]
if N % 2 == 0:
    for i, a in enumerate(A):
        if i % 2 == 0:
            B[N//2 + i//2] = a
        else:
            B[N//2 - (i+1)//2] = a
else:
    for i, a in enumerate(A):
        if i % 2 == 0:
            B[N//2 - i//2] = a
        else:
            B[N//2 + (i+1)//2] = a

print(' '.join(B))

Solution (Python):
n = int(input())
a = input().split()
a_odd  = []
a_even = []
for i in range(n):
    if (i+1)%2 == 0:
        a_even.append(a[i])
    else:
        a_odd.append(a[i])
        
if n%2 == 0:
    print(" ".join(a_even[::-1] + a_odd))
else:
    print(" ".join(a_odd[::-1] + a_even))

Solution (Python):

from collections import deque
n = int(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])
if n % 2 == 1:
    ans = list(ans)[::-1]
print(" ".join(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%2==0:
        b.appendleft(a[i])
    else:
        b.append(a[i])
else:
    if n%2==0:
        b = list(b)
        b = b[::-1]
print(*b)

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.append(a[i])
    else:
        b.appendleft(a[i])
if n % 2 == 1:
    b.reverse()

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

Solution (Python):
n = int(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)))

Solution (Python):



from collections import deque

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

b = deque(maxlen=n)

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])
print(*b)

Solution (Python):
import sys
from collections import deque


n = int(sys.stdin.readline().strip())
A = map(int, sys.stdin.readline().strip().split())

q = deque()
for i, a_i in enumerate(A):
    if i % 2 == 0:
        q.append(a_i)
    else:
        q.appendleft(a_i)

ans = list(map(str, q))
if n % 2 == 1:
    ans = ans[::-1]

print(" ".join(ans))

Solution (Python):
from collections import deque
n=int(input())
a=list(map(int,input().split()))
b=deque(maxlen=2*10**5)
if n%2==0:
  for i in range(n):
    if i%2==1:
      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):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n=I()
lis=LI()
odd=[];eve=[]
for i in range(n):
    if i%2==1:
        eve.append(lis[i])
    else:
        odd.append(lis[i])
if n%2==0:
    eve=list(reversed(eve))
    for s in eve:
        print(s,end=" ")
    for t in odd:
        print(t,end=" ")
else:
    odd=list(reversed(odd))
    for s in odd:
        print(s,end=" ")
    for t in eve:
        print(t,end=" ")

Solution (Python):
def main():
    from collections import deque

    N = int(input())
    A = input().split()

    ret = deque()
    head_is_0 = 1
    for x in A:
        if head_is_0:
            ret.append(x)
        else:
            ret.appendleft(x)
        head_is_0 ^= 1

    if head_is_0 == 0:
        ret.reverse()
    print(*ret)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = input().split()
R = []
L = []
for i,a in enumerate(A):
    if i%2 == 0:
        R.append(a)
    else:
        L.append(a)
ans = list(reversed(L))+R
if N%2 == 0:
    print(' '.join(ans))
else:
    print(' '.join(list(reversed(ans))))

Solution (Python):
def main():
    n = int(input())
    A = input().split()
    ans = list(reversed(A[1::2])) + A[::2]
    if n % 2 == 0:
        print(' '.join(ans))
    else:
        print(' '.join(list(reversed(ans))))


if __name__ == '__main__':
    main()

Solution (Python):
def make_indices_list(n):
  """
  Args:
    n (int)

  >>> make_indices_list(8):
  [7, 5, 3, 1, 0, 2, 4, 6]
  >>> make_indices_list(7):
  [6, 4, 2, 0, 1, 3, 5]
  """
  if n % 2 == 0:
    return list(range(n-1, 0, -2)) + list(range(0, n, 2))
  else:
    return list(range(n-1, -1, -2)) + list(range(1, n-1, 2))
    


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

indices_list = make_indices_list(n)
for ind in indices_list:
  print(L[ind], end=' ')
print('')

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

b = deque()

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

print(' '.join(b))

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

odd = []
even = []
for i in range(n):
    if i%2 == 0:
        odd.append(s[i])
    else:
        even.append(s[i])
    
if n%2 == 1:
    ans = odd[::-1] + even
else:
    ans = even[::-1] + odd
    
ans_str=[str(a) for a in ans]
print(" ".join(ans_str))

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

odd = []
even = []
for i in range(n):
    if i%2 == 0:
        odd.append(s[i])
    else:
        even.append(s[i])
    
ans = odd[::-1] + even
ans_str=[str(a) for a in ans]

if n%2 == 1:
    print(" ".join(ans_str))
else:
     print(" ".join(ans_str[::-1]))

Solution (Python):
from collections import deque

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

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

if len(a)%2 == 0:
  B = ' '.join(b)
  print(B)
else:
  b.reverse()
  B = ' '.join(b)
  print(B)

Solution (Python):
from collections import deque
n=int(input())
a=list(map(str,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(b))

Solution (Python):
from collections import deque


def main():
    N = int(input())
    A = list(map(int, input().split(' ')))
    que = deque()
    for i, a in enumerate(A):
        if (i + 1) % 2 == 1:
            que.append(a)
        else:
            que.appendleft(a)
    ans = list(que)
    if N % 2 == 1:
        ans.reverse()
    print(' '.join(map(str, ans)))


if __name__ == '__main__':
    main()

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

if __name__ == '__main__':
    main()

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

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 and i%2 == 0:
        d.append(a[i])
    elif n%2==1 and i%2==1:
        d.append(a[i])
    else:
        d.appendleft(a[i])
print(' '.join(map(str,list(d))))

Solution (Python):
from collections import deque
n = int(input())
*a, = map(int, 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([str(v) for v in b]))

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

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

from collections import deque
b = []
b = deque(b)

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

if n%2==0:
    print(' '.join(b))
else:
    print(' '.join(reversed(b)))

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

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

Solution (Python):
import sys

import math


from collections import deque

from fractions  import gcd


n=int(input())
a=list(map(int,input().split()))
b=[0]*((n+1)//2)
c=[0]*(n//2)

for i in range((n+1)//2):
    b[i]=a[i*2]
for i in range(n//2):
    c[i]=a[i*2+1]
c.reverse()
c.extend(b)
if n%2==1:
    c.reverse()
print(*c)

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

odd = [v for i, v in enumerate(a[1:]) if i % 2 == 1]
even = [v for i, v in enumerate(a[1:]) if i % 2 == 0]

ans = []
if n % 2 == 0:
    ans = even[::-1] + [a[0]] + odd
else:
    ans = odd[::-1] + [a[0]] + even

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

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

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


print(*ans)