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):
def examC():
    N = I()
    a = LI()
    v = [i for i in range(N)]
    if N%2==0:
        ans = a[::-2]
        ans.extend(a[0::2])
    else:
        ans = a[-1::-2]
        ans.extend(a[1::2])
    print(" ".join(map(str,ans)))



import sys
import copy
import bisect
import heapq
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examC()

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

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

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

print(*ans)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
a1 = a[::2]
a2 = a[1::2]
if n % 2:
  print(*a1[::-1],sep=' ',end=' ')
  print(*a2,sep=' ')
else:
  print(*a2[::-1],sep=' ',end=' ')
  print(*a1,sep=' ')

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

for i in ans:
    print(str(i) + " ", end = "")

Solution (Python):
from collections import deque

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

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

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

print(' '.join(b))

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

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

print(*b)

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

b_even = [x for n, x in enumerate(a) if (n+1) % 2 == 0]
b_odd = [x for n, x in enumerate(a) if (n+1) % 2 == 1]

if n % 2 == 0:
    b_even.reverse()
    res = b_even + b_odd
else:
    b_odd.reverse()
    res = b_odd + b_even

print(*res)

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
if n >= 2:
  for i in range(n, 0, -2):
    print(A[i-1], end=" ")
  for i in range(n % 2, n - 2, 2):
    print(A[i], end=" ")
  print(A[n-2])
if n == 1:
  print(*A)

Solution (Python):
n = int(input())
A = list(map(str, input().split()))
print(" ".join(A[::-2]) + " " + " ".join(A[-2::-2][::-1]))

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

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

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

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

b = []
if n % 2 == 0:
    for i in range(n//2):
        b.append(a[-1-i*2])
    for i in range(n//2):
        b.append(a[i*2])
else:
    for i in range(n//2+1):
        b.append(a[-1-i*2])
    for i in range(0, n//2):
        b.append(a[1+i*2])
print(' '.join(map(str, b)))

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

b1 = aa[::-2] 
b2 = aa[-2::-2][::-1]
b1.extend(b2)

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

Solution (Python):
import collections

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

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

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

print(*b)

Solution (Python):
from collections import deque

N = int(input())
li = input().split()
ans = deque()
if N % 2 == 0:
    for i in range(N):
        if i % 2 == 0:
            ans.append(li[i])
        elif i % 2 == 1:
            ans.appendleft(li[i])
else:
    for i in range(N):
        if i % 2 == 0:
            ans.appendleft(li[i])
        elif i % 2 == 1:
            ans.append(li[i])
for i in range(N):
    print(ans[i],end=' ')

Solution (Python):
from collections import deque

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

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

    if N % 2 == 1:
        deq.reverse()
    print(" ".join(deq))


if __name__ == "__main__":
    main()

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

    
    
    
    
    
    

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

    else:
        for i in range(1, N, 2):
            b.append(A[i])

    print(" ".join(b))


if __name__ == "__main__":
    main()

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

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

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

for elem in b: print(elem, end=' ')

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

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

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

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

for elem in b: print(elem, end=' ')

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


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

b = [None] * n
for i in range(n):
    if i % 2 == 0: b[n // 2 + i // 2] = a[i]
    else: b[n // 2 - (-(-i // 2))] = a[i]
if (n - 1) % 2 == 0: b = list(reversed(b))

for elem in b: print(elem, end=' ')

Solution (Python):
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    A = string_to_int(inputs[0])
    b = collections.deque([])

    for i, a in enumerate(A):
        if i % 2 == 0:
            b.append(str(a))
        else:
            b.appendleft(str(a))
    if len(b) % 2 != 0:
        b.reverse()
    return ' '.join(b)


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    input()
    ret = solve(inputs(1))
    print(ret)

Solution (Python):
def main():
    from collections import deque
    N = int(input())
    A = [int(i) for i in input().split()]
    B = deque()
    if N & 1:
        for i, a in enumerate(A):
            if i & 1:
                B.append(a)
            else:
                B.appendleft(a)
    else:
        for i, a in enumerate(A):
            if i & 1:
                B.appendleft(a)
            else:
                B.append(a)
    print(*B)


if __name__ == '__main__':
    main()

Solution (Python):


from collections import deque

n ,*a = map(int, open(0).read().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):
N = int(input())
A = list(map(int, input().split()))

B=[]

if(N%2==0):
    for i in range(N-1,-1,-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 = [int(e) for e in input().split()]













b = []




b = [a_list[n-1-i] for i in range(0,n,2)]


if n%2==0:
    
    
    after_b = [a_list[i*2] for i in range(0,n//2,1)]
else:
    
    
    after_b = [a_list[i*2+1] for i in range(0,n//2,1)]
    
print(' '.join(map(str, b + after_b)))

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

anseven=C[::-1]+B
ansodd=B[::-1]+C

if N%2==1:
    print(*ansodd)
else:
    print(*anseven)

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

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

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

for a in Ans:
    print(a,end=' ')

Solution (Python):

import sys
from collections import deque

def solve(n: int, a: "List[int]"):
    
    li = deque()

    for i in range(n):
        if i%2!=n%2:
            li.appendleft(a[i])
        else:
            li.append(a[i])
    
    print(" ".join(map(str,list(li))))

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = int(next(tokens))  
    a = [int(next(tokens)) for _ in range(n)]  
    solve(n, a)

if __name__ == '__main__':
    main()

Solution (Python):

import sys
from collections import deque

def solve(n: int, a: "List[int]"):
    
    li = deque()

    for i in range(n):
        if i%2==0:
            li.appendleft(a[i])
        else:
            li.append(a[i])
    
    if n%2 == 0:
        li = list(li)[::-1]
    
    
    print(" ".join(map(str,list(li))))

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = int(next(tokens))  
    a = [int(next(tokens)) for _ in range(n)]  
    solve(n, a)

if __name__ == '__main__':
    main()

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



ans = [0] * n

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

Solution (Python):
n=int(input())
ae=[];ao=[]
for i,ai in enumerate(list(map(int,input().split()))):
    if i%2==0:
        ae.append(ai)
    else:
        ao.append(ai)

if n%2==0:
    ans=ao[::-1]+ae
else:
    ans=ae[::-1]+ao

print(*ans)

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

ae=[];ao=[]

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

if n%2==0:
    ans=ao[::-1]+ae
else:
    ans=ae[::-1]+ao

print(*ans)

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

b = []
tmp = []

for i in range(N):
    if i % 2 == 0:
        b.append(A[i])
    else:
        tmp.append(A[i])
tmp.reverse()
tmp.extend(b)
if N % 2 == 1:
    tmp.reverse()
print(" ".join(map(str, tmp)))

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()))
answer = A[1::2][::-1]+A[::2]
if n%2==1:
    answer=answer[::-1]
print(*answer)

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

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

farm=[]
latt=[]

for i,x in enumerate(a):
    if i%2 == (n-1)%2:
        farm.append(x)
    else:
        latt.append(x)
farm.reverse()
ans = farm + latt

print(*ans)

Solution (Python):
N=int(input())
middle = N//2
a = input().split()



ans=[0 for i in range(N)]
ans[middle]=a[0]

j=1
diff = -1 if N%2 ==0 else 1
for i, aa in enumerate(a[1:]):
    ans[middle + j*diff] = aa
    diff *= -1
    if (i+1)>1 and (i+1)%2==0:
        j+=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.append(a[i])
    else:
        b.appendleft(a[i])

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

print(*b)

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

a = input().split()

center=a[0]


tail = ""
head = ""
if N>=2:
    tail =a[2:][::2]
    head = a[1:][::2]

if N==1:
    print(center)
elif N==2:
    print(" ".join(a))
elif N%2==0:
    print(" ".join(head[::-1])+" "+ center +" "+" ".join(tail))
else:
    print(" ".join(tail[::-1])+" "+ center +" "+" ".join(head))

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

Solution (Python):
n=int(input())
l1=[]
l=[int(i) for i in input().split()]
from collections import deque 
l1=deque()
if n%2==0:
   
    p=0 
    for i in l:
        if p==0:
            l1.append(i)
        else:
            l1.appendleft(i)
        p=1-p 
    print(*l1)
else:
   
    p=0 
    for i in l:
        if p==0:
            l1.appendleft(i)
        else:
            l1.append(i)
        p=1-p 
    print(*l1)

Solution (Python):
N = int(input())
a1 = []
a2 = []
for i, v in enumerate(input().split()):
    if i % 2 == 0:
        a1.append(v)
    else:
        a2.append(v)

if N % 2 == 0:
    a1, a2 = a2, a1
if a1:
    print(*reversed(a1),end=' ')
print(*a2)

Solution (Python):
N=int(input())
li=list(map(int,input().split()))
if N%2==0:
    ans_normal=li[::2]
    ans_rev=li[1::2]
else:
    ans_rev=li[::2]
    ans_normal=li[1::2]  
ans_rev.reverse()
ans=ans_rev+ans_normal
for n in range(N):
    ans[n]=str(ans[n])
print(' '.join(ans))

Solution (Python):
N=int(input())
li=list(map(int,input().split()))
if N%2==0:
    ans_normal=li[::2]
    ans_rev=li[1::2]
else:
    ans_rev=li[::2]
    ans_normal=li[1::2]  
ans_rev.reverse()
ans=ans_rev+ans_normal
for n in range(N):
    ans[n]=str(ans[n])
print(' '.join(ans))

Solution (Python):
N=int(input())
li=list(map(int,input().split()))
ans_odd=[]
ans_even=[]
if N%2==0:
    ans_normal=li[::2]
    ans_rev=li[1::2]
else:
    ans_rev=li[::2]
    ans_normal=li[1::2]  
ans_rev.reverse()
ans=ans_rev+ans_normal
for n in range(N):
    ans[n]=str(ans[n])
print(' '.join(ans))

Solution (Python):
def main():
    n, *a = open(0).read().split()
    if int(n) % 2:
        print(" ".join(reversed(a[0::2])), end=" ")
        print(" ".join(a[1::2]))
    else:
        print(" ".join(reversed(a[1::2])), end=" ")
        print(" ".join(a[0::2]))
    return


main()

Solution (Python):
from collections import deque


def main():
    n, *a = open(0).read().split()
    dq = deque()
    n = int(n) - 1
    for i, ai in enumerate(a):
        if i % 2 == n % 2:
            dq.appendleft(ai)
        else:
            dq.append(ai)
    print(" ".join(dq))
    return


main()

Solution (Python):
from collections import deque


def main():
    n, *a = map(int, open(0).read().split())
    dq = deque()
    n -= 1
    for i, ai in enumerate(a):
        if i % 2 == n % 2:
            dq.appendleft(ai)
        else:
            dq.append(ai)
    print(" ".join(map(str, dq)))
    return


main()

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

print(*a_list[::-2], end = ' ')
print(*a_list[n%2::2])

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()))
    d = collections.deque()
    for i in range(n):
        if n % 2 == i % 2:
            d.append(a[i])
        else:
            d.appendleft(a[i])
    print(*d)


if __name__ == '__main__':
    slove()

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

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

Odd = []
Even = []

for i in range(n):
    if i%2:
        Even.append(A[i])
    else:
        Odd.append(A[i])

if n%2:
    print(*(list(reversed(Odd))+Even))
else:
    print(*(list(reversed(Even))+Odd))

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
for i in range(N):
  if(i%2==0):
    print(A[N-1-i],end=" ")
for i in range(N):
  if(N%2):
    if(i%2):
      print(A[i],end=" ")
  else:
    if(i%2==0 and i!=N-2):
      print(A[i],end=" ")
    elif(i==N-2):
      print(A[i])
if(N==1):
  print()

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

Solution (Python):
from collections import deque

n = int(input())
A = deque(map(int,input().split()))
B = deque()

for i in range(n):
    a = A.popleft()
    if i%2==0:
        B.append(a)
    else:
        B.appendleft(a)

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

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

list_even_idx = [str(a) for i, a in enumerate(list_a) if i % 2 == 0]
list_odd_idx = [str(a) for i, a in enumerate(list_a) if i % 2 != 0]

if n % 2 == 0:
  result1 = " ".join(list_odd_idx[::-1])
  result2 = " ".join(list_even_idx)
  print(result1 + " " + result2)
else:
  result1 = " ".join(list_even_idx[::-1])
  result2 = " ".join(list_odd_idx)
  print(result1 + " " + result2)

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

list_even_idx = []
list_odd_idx = []
for i, a in enumerate(list_a):
  if i % 2 == 0:
    list_even_idx.append(str(a))
  else:
    list_odd_idx.append(str(a))

if n % 2 == 0:
  result1 = " ".join(list_odd_idx[::-1])
  result2 = " ".join(list_even_idx)
  print(result1 + " " + result2)
else:
  result1 = " ".join(list_even_idx[::-1])
  result2 = " ".join(list_odd_idx)
  print(result1 + " " + result2)

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 len(a) % 2 == 1:
    b = list(b)
    b = b[::-1]
    
print(*b)

Solution (Python):


def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

    n = int(input())
    as_ = list(map(int, input().split()))
    b = [0] * n

    odd_a = as_[::2]
    even_a = as_[1::2]
    if n % 2 == 0:
        ans = even_a[::-1] + odd_a
    else:
        ans = odd_a[::-1] + even_a
    print(*ans)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
bl = []
br = []
for i in range(n):
    if i%2==0:
        br.append(a[i])
    else:
        bl.append(a[i])
bl.reverse()
if n%2 == 0:
    for i in bl+br:
        print(i)
else:
    for i in reversed(bl+br):
        print(i)

Solution (Python):
def c_pushpush():
    
    
    N = int(input())
    A = [int(i) for i in input().split()]
    return ' '.join(map(str, A[int(N % 2 == 0)::2][::-1] + A[int(not N % 2 == 0)::2]))

print(c_pushpush())

Solution (Python):

from collections import deque
n = int(input())
a = list(map(int, 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.append(a[i])
        else:
            b.appendleft(a[i])

print(*b, end=" ")

Solution (Python):
n = int(input())
a = tuple(map(int, input().split()))
reverse_a = a[::-1]


if n % 2 == 0:
    first = first = reverse_a[::2]
    second = a[::2]
else:
    first = reverse_a[::2]
    second = a[1:n:2]

print(*first+second)

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

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

print(*b, sep=" ")

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

B=[]

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


print(" ".join(B))

Solution (Python):
import collections
n=int(input())
a=list(map(int,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:
  b.reverse()
print(*b)

Solution (Python):
import collections
N = int(input())
A = [i for i in input().split()]
 
ans = collections.deque()
for i in range(N):
    if (i+1)%2==N%2:
        ans.appendleft(A[i])
    else:
        ans.append(A[i])
print(*ans)

Solution (Python):
from collections import deque

def solve():
    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(' '.join(map(str, b)))
    
solve()

Solution (Python):
def solve():
    N = int(input())
    A = map(int, input().split())
    b = []
    left = []
    right = []
    for i,a in enumerate(A):
        if i%2 == 0:
            right.append(a)
        else:
            left.append(a)
            

    if N % 2 == 1:
        right.reverse()
        b = right+left
    else:
        left.reverse()
        b = left + right
    print(' '.join(map(str, b)))
    
solve()

Solution (Python):
from collections import deque
 
N = int(input())
A = [int(i) for i in input().split()]
 
B = deque(maxlen=2*10**5)
 
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=list(map(int,input().split()))

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

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

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

ans = collections.deque()
for i in range(N):
    if (i+1)%2==N%2:
        ans.appendleft(A[i])
    else:
        ans.append(A[i])
print(*ans)

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

for i in ans:
    print(i, end=' ')

Solution (Python):
N=int(input())
arr=input().split()
ans=arr[::2][::-1]+arr[1::2]
if not N&1:
    ans=ans[::-1]
print(*ans,sep=' ')

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

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

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

Solution (Python):

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

B1 = deque()
B2 = deque()

for i in range(N):
    if i == 0:
        B1.appendleft(A[0])
        B2.appendleft(A[0])
    
    if i > 0 and i%2 == 1:
        B1.append(A[i])
        B2.appendleft(A[i])
    elif i > 0 and i%2 == 0:
        B1.appendleft(A[i])
        B2.append(A[i])

if N%2 == 1:
    B1 = list(B1)
    print(*B1)
elif N%2 == 0:
    B2 = list(B2)
    print(*B2)

Solution (Python):
from collections import deque as dq
def main():
    n=int(input())
    a=list(map(int,input().split(' ')))
    b=dq([a[0]])
    for num,i in enumerate(a[1:]):
        if num%2==0:
            b.appendleft(i)
        else:
            b.append(i)
    if len(a)%2==0:
        for i in b:
            print(i)
    else:
        for i in reversed(b):
            print(i,'',end='')

if __name__ == '__main__':
    main()

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

Solution (Python):
import queue as que
n=int(input())
a=list(input().split())
q=que.Queue()
s=[]
i=1
if n%2:
    for A in a:
        if i%2: s.append(A)
        else: q.put(A)
        i+=1
else:
    for A in a:
        if i%2: q.put(A)
        else: s.append(A)
        i+=1
for _ in range(len(s)): print(s.pop())
while not q.empty() :print(q.get())

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

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

Solution (Python):


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

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

print(*left+right[::-1])

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

Solution (Python):
from collections import deque

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

offset = 0 if N % 2 == 0 else 1
ans = deque([A[0]])
for i in range(1, N):
    if (i+offset) % 2 == 0:
        ans.append(A[i])
    else:
        ans.appendleft(A[i])

print(" ".join(ans))

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

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

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

A_odd = A[::2]
A_even = A[1::2]

if N % 2 == 0:
    answer = A_even[::-1] + A_odd
else:
    answer = A_odd[::-1] + A_even
print(*answer)

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

print(' '.join(a[-1::-2] + a[(n % 2)::2]))

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

Solution (Python):
from collections import deque

q = deque()

n = int(input())
*a, = map(int, input().split())
for i, x in enumerate(a):
    if i % 2 == 0:
        q.append(x)
    else:
        q.appendleft(x)
if n % 2:
    print(*reversed(q))
else:
    print(*q)

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):
n = int(input())
a = list(input().split())
print(' '.join(a[::-2] + a[n%2::2]))

Solution (Python):
import collections

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

B=collections.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):

N = int(input())
A = list(map(int,input().split()))
if N%2 == 0:
    front = []
    back = []
    for i in range(N):
        if i%2 == 1:
            front.append(A[i])
        else:
            back.append(A[i])
    front = front[::-1]
    for i in range(N//2):
        print(front[i],end=" ")
    for i in range(N//2):
        print(back[i],end=" ")
        
else:
    front = []
    back = []
    for i in range(N):
        if i%2 == 0:
            front.append(A[i])
        else:
            back.append(A[i])
    front = front[::-1]
    for i in range(N//2 + 1):
        print(front[i],end=" ")
    for i in range(N//2):
        print(back[i],end=" ")

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

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

print(*z)