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()))
b = [0 for _ in range(n)]
count = 0
i = 0
j = -1
k = -1

for _ in range(n):
  if count % 2 == 0:
    b[i] = a[k]
    i += 1
    k -= 1
  else:
    b[j] = a[k]
    j -= 1
    k -= 1
  count += 1

print(*b)

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

Solution (Python):
import sys
from collections import deque

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

ans = deque()

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

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

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

Solution (Python):
import sys

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

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

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

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

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

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

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

b = ' '.join(B) 
print(b)

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

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    A = list(map(str, input().split()))

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

    if len(A) % 2 == 0:
        return ' '.join(even[::-1] + odd)
    else:
        return ' '.join(odd[::-1] + even)


if __name__ == '__main__':
    print(main())

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] = a[n-i-1]
    if i % 2 == 1:
        b[n-((i+1)//2)] = a[n-(i+1)]


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

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.appendleft(a)
    else:
        B.append(a)

if N % 2 == 0:
    B.reverse()

B = list(map(str, list(B)))

print(" ".join(B))

Solution (Python):
N = int(input())
alist = list(input().split())
if N % 2 == 0:
    a1 = alist[1::2]
    a2 = alist[0::2]
    a1.reverse()
    a1.extend(a2)
else:
    a1 = alist[0::2]
    a2 = alist[1::2]
    a1.reverse()
    a1.extend(a2)
c = ' '.join(a1)
print(c)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
b=[]
c=[]
for i in range(n):
  if i%2!=n%2:
    b.append(a[i])
  else:
    c.append(a[i])
b.reverse()
b.extend(c)
print(' '.join(map(str,b)))

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

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





if n == 1:
    print(a[0])
    exit()

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

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

if n%2 == 0:
    x = a[::2]
    y = a[-1::-2]
    ans = y+x
else:
    x = a[::-2]
    y = a[1::2]
    ans = x+y

ans = " ".join(ans)
print(ans)

Solution (Python):
n=int(input())
A=input().split()
print(' '.join(A[(n+1)%2::2][::-1]+A[n%2::2]))

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


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):
from collections import deque
n = int(input())
A = list(map(int, input().split()))
X = deque([str(A[0])])
append_ = True if n % 2 != 0 else False
for a in A[1:]:
    if append_:
        X.append(str(a))
    else:
        X.appendleft(str(a))
    append_ = not append_
print(" ".join(X))

Solution (Python):
def pushpush(N: int, A: list)->list:
    b = []
    for i, a in enumerate(reversed(A)):
        if i % 2 == 0:
            b.append(a)
    for i, a in enumerate(A):
        if i % 2 == N % 2:
            b.append(a)
    return b


if __name__ == "__main__":
    N = int(input())
    A = [int(s) for s in input().split()]
    ans = pushpush(N, A)
    print(' '.join(map(str, ans)))

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

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

Solution (Python):
from collections import deque
n = int(input())
a = [int(i) for i in input().split()]
b = deque()
for i, x in enumerate(a):
    if i%2 == n%2:
        b.append(x)
    else:
        b.appendleft(x)
print(*b)

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

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

for num in nums:
    print(num, '', end='')

Solution (Python):
input();a=input().split();print(' '.join(a[::-2]+a[len(a)%2::2]))

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

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.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=[int(i) for i in input().split()]
ans=deque([])
for i,j in enumerate(a):
    if n%2==i%2:
        ans.append(j)
    else:
        ans.appendleft(j)
print(*ans,sep=' ')

Solution (Python):
from collections import deque
n = int(input())
mod2 = n % 2
a = list(map(int, input().split()))
ans = deque()
for key,value in enumerate(a):
  if mod2 == key % 2:
    ans.append(value)
  else:
    ans.appendleft(value)
print(*ans)

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

L = [] 
if N % 2 == 0:
    for i in range(1,N//2+1):
        L.append(2 * i)
    L = sorted(L, reverse=True)
    for i in range(1,N//2+1):
        L.append(2 * i - 1)
else:
    for i in range(1,(N + 1)// 2 + 1):
        L.append(2 * i - 1)
    L = sorted(L, reverse=True)
    for i in range(1,(N + 1)// 2):
        L.append(2 * i)
        
ans = ''
for i,j in enumerate(L):
    ans  += str(A[j-1]) + ' '
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 == 1:
    q.reverse()

for i in range(n):
    if i != n - 1:
        print("{} ".format(q[i]), end= "")
    else:
        print("{}".format(q[i]))

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

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])
    elif i%2==1:
        b.append(A[i])
ans=''
if n%2==0:
    for i in range(n):
        ans+=str(b[n-i-1])+' '
else:
    for i in range(n):
        ans+=str(b[i])+' '
print(ans[:-1])

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

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

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

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

x = a[::2]
y = a[1::2]

if n%2==0:
    res = y[::-1] + x
else:
    res = x[::-1] + y

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

Solution (Python):
n = int(input())
A = list(map(int,input().split()))
b = []
if n%2==0:
    x = A[-1::-2]
    y = A[0::2]
    b.extend(x)
    b.extend(y)
else:
    x = A[-1::-2]
    y = A[1::2]
    b.extend(x)
    b.extend(y)
print(*b)

Solution (Python):
from collections import deque


def main():
    N = int(input())
    A = list(map(int, input().split()))
    q = deque()
    for i in range(N):
        if (N-i) % 2 == 1:
            q.appendleft(A[i])
        else:
            q.append(A[i])
    print(" ".join(map(str, q)))


if __name__ == "__main__":
    main()

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

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

Solution (Python):
import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int,input().split()))
A2 = [A[i] for i in range(1,n,2)]
A0 = [A[i] for i in range(0,n,2)]
if len(A) == 1:
    ans = A
else:
    ans = A0[::-1]
    ans += A2
if n % 2 == 0:
    ans = ans[::-1]
print(*ans)

Solution (Python):

from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007






n = I()
a = LI()
b = [None for i in range(n)]
k = n//2
if n%2:
    for i in range(n):
        if i%2:
            b[k+(i+1)//2] = a[i]
        else:
            b[k-i//2] = a[i]
else:
    for i in range(n):
        if i%2:
            b[k-(i+1)//2] = a[i]
        else:
            b[k+i//2] = a[i]
print(*b)

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

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

b = []

for i in range(n-1,0,-2):
    print(a[i],end="")
    a.pop(i)
    print(" ",end="")
print(" ".join(map(str,a)))

Solution (Python):

N=int(input())
A=list(map(int,input().split()))
B=[0 for n in range(N)]
for n in range(N):
	B[(-1)**(n%2)*n//2]=A[-n-1]
print(' '.join(map(str,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(" ".join(b))

Solution (Python):
def main():
    _ = int(input())
    a = [int(s) for s in input().split()]
    print(*solve(a))

def solve(a):
    if len(a) % 2 == 0:
        return a[-1::-2] + a[0::2]
    else:
        return a[-1::-2] + a[1::2]

main()

Solution (Python):
from collections import deque
n=int(input())
a=list(map(int,input().split()))
b=deque()
for i in range(n):
    if (i+1)%2==1:
        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:
    x=a[::2]
    y=a[1::2]
    y.reverse()
    b=y+x
    print(*b)
else:
    x=a[::2]
    y=a[1::2]
    x.reverse()
    b=x+y
    print(*b)

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

Solution (Python):
int_n = int(input())
ar_int_a = list(map(int, input().split()))
ar_int_b = [-1] * int_n


idx = (int_n // 2)
ar_int_b[idx] = ar_int_a[0]

if int_n % 2 == 0:
    
    for i in range(1, int_n):
        if i % 2 == 0:
            idx = idx + i
        else:
            idx = idx + (-1 * i)
        ar_int_b[idx] = ar_int_a[i]
else:
    
    for i in range(1, int_n):
        if i % 2 == 0:
            idx = idx + (-1 * i)
        else:
            idx = idx + i
        ar_int_b[idx] = ar_int_a[i]


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

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

B = deque()
for i in range(N):
    if lenA % 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(' '.join(map(str, B)))

Solution (Python):
n = int(input())
L = [None]+list(input().split())
even = []
odd = []
if n % 2 == 0:
    for i in range(1,1+n):
        if i % 2 == 0:
            even.append(L[i])
        else:
            odd.append(L[i])
    ans = even[::-1] + odd
else:
    for i in range(1,1+n):
        if i % 2 == 0:
            even.append(L[i])
        else:
            odd.append(L[i])
    ans = odd[::-1] + even
for i in range(n-1):
    print(ans[i],end=' ')
print(ans[n-1])

Solution (Python):
n = int(input())
L = [None]+list(input().split())
even = []
odd = []
if n % 2 == 0:
    for i in range(1,1+n):
        if i % 2 == 0:
            even.append(L[i])
        else:
            odd.append(L[i])
    ans = even[::-1] + odd
else:
    for i in range(1,1+n):
        if i % 2 == 0:
            even.append(L[i])
        else:
            odd.append(L[i])
    ans = odd[::-1] + even
for i in range(n-1):
    print(ans[i],end=' ')
print(ans[n-1])

Solution (Python):
n = int(input())
L = [None]+list(input().split())
even = []
odd = []
if n % 2 == 0:
    for i in range(1,1+n):
        if i % 2 == 0:
            even.append(L[i])
        else:
            odd.append(L[i])
    ans = even[::-1] + odd
else:
    for i in range(1,1+n):
        if i % 2 == 0:
            even.append(L[i])
        else:
            odd.append(L[i])
    ans = odd[::-1] + even
for i in range(n):
    if i == n - 1:
        print(ans[i])
    else:
        print(ans[i],end=' ')

Solution (Python):
n = int(input())
L = [None]+list(input().split())
even = []
odd = []
if n % 2 == 0:
    for i in range(1,1+n):
        if i % 2 == 0:
            even.append(L[i])
        else:
            odd.append(L[i])
    ans = even[::-1] + odd
else:
    for i in range(1,1+n):
        if i % 2 == 0:
            even.append(L[i])
        else:
            odd.append(L[i])
    ans = odd[::-1] + even
for i in range(n):
    if i == n - 1:
        print(ans[i])
    else:
        print(ans[i],end=' ')

Solution (Python):
n = int(input())
L = [None]+list(input().split())
even = []
odd = []
if n % 2 == 0:
    for i in range(1,1+n):
        if i % 2 == 0:
            even.append(L[i])
        else:
            odd.append(L[i])
    for x in even[::-1]:
        print(x,end=' ')
    for y in odd:
        print(y,end=' ')
    print()
else:
    for i in range(1,1+n):
        if i % 2 == 0:
            even.append(L[i])
        else:
            odd.append(L[i])
    for y in odd[::-1]:
        print(y,end=' ')
    for x in even:
        print(x,end=' ')
    print()

Solution (Python):
n=int(input())
a=[i for i in 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:
  if n==1:
    print(a[0])
  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(input().split())

b = ['' for _ in range(n)]
m = n // 2

b[m] = a[0]

p = 1

for i in range(1, n):
    if i % 2 == 1:
        b[m - p] = a[i]
    else:
        b[m + p] = a[i]
        p += 1

if n % 2 == 1:
    b = list(reversed(b))

print(' '.join(b))

Solution (Python):
n = int(input())
a = input().split()
print(" ".join(a[::-2]+a[n%2::2]))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
la = len(a)
res = [0] * la
s = 0
l = la - 1
if la % 2 == 0:
    for i in range(la)[::-1]:
        if i % 2 != 0:
            res[s] = a[i]
            s += 1
        else:
            res[l] = a[i]
            l -= 1
else:
    for i in range(1, la)[::-1]:
        if i % 2 == 0:
            res[s] = a[i]
            s += 1
        else:
            res[l] = a[i]
            l -= 1
    res[s] = a[0]
print(" ".join([str(i) for i in res]))

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

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

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

left = True
ans = deque()
while A:
    if left: ans.appendleft(A.pop())
    else: ans.append(A.pop())
    left = not left
if n % 2 == 0: ans.reverse()
print(' '.join(str(a) for a in ans))

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
if n%2==0:
  b=[str(v) for k,v in enumerate(a) if k%2==0]
  c=[str(v) for k,v in enumerate(a) if k%2==1][::-1]
  print(" ".join(c+b))
else:
  b=[str(v) for k,v in enumerate(a) if k%2==0][::-1]
  c=[str(v) for k,v in enumerate(a) if k%2==1]
  print(" ".join(b+c))

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

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

if N%2==0:
    ans1 = A[1::2][::-1]
    ans2 = A[0::2]
else:
    ans1 = A[0::2][::-1]
    ans2 = A[1::2]

print(" ".join(map(str,ans1))," ".join(map(str,ans2)))

Solution (Python):


















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


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

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

if n%2 == 0:
  ans = list(reversed(c)) + b
  print(*ans, sep=" ")
else:
  ans = list(reversed(b)) + c
  print(*ans, sep=" ")

Solution (Python):
def solve(n, As):
    odd = As[1::2]
    even = As[::2]
    if n % 2 == 0:
        return " ".join(map(str, odd[::-1] + even))
    else:
        return " ".join(map(str, even[::-1] + odd))

if __name__ == "__main__":
    n = int(input())
    As = list(map(int, input().split(" ")))
    print(solve(n, As))

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

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

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

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

Solution (Python):
import collections

def solve():
    N = int(input())
    a = [int(x) for x in input().split()]

    q = collections.deque()

    methods = [q.append, q.appendleft]
    for i in range(N):
        methods[i%2](a[i])

    if N%2==1:
        q = list(reversed(q))
    s = (" ".join(map(str, q)))
    print(s)


def main():
    solve()


if __name__ == '__main__':
    main()

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

Solution (Python):
n = int(input())
A = [int(i) for i in input().split()]
odd = A[1::2]
even = A[0::2]

if len(A) % 2 == 0:
    odd.reverse()
    ans = odd + even
else:
    even.reverse()
    ans = even + odd
    
print(' '.join(map(str, ans)))

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

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

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

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

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

print(str(ans).replace("[","").replace("]","").replace(",","") if n%2 ==0 else str(ans[::-1]).replace("[","").replace("]","").replace(",","") )

Solution (Python):
import collections
def a():return input()
def ai():return int(input())
def ma():return map(int, input().split())
def ms():return map(str, input().split())
def lma():return list(map(int, input().split()))
def lms():return list(map(str, input().split()))
k= []
l = []
f = 0
def say(i):return print("Yes" if i == 0 else "No")
def Say(i):return print("YES" if i == 0 else "NO")
a = ai()
x = lma()
k = [0]*a
s = 0
t = 0
for i in range(a):
    if i%2==0:
        k[s] = x[-1-i]
        s+=1
    else:
        k[-t-1] = x[-1-i]
        t+=1
s = str(k[0])
for i in range(1,a):
    s+=" "+str(k[i])
print(s)

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

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

Solution (Python):
"""
an,a(n-2),          a(n-3) , a(n-1)
"""
import sys
input = sys.stdin.readline

n = int(input())
nums = list(map(int, input().split()))
ri = []
le = []
if n % 2 == 0:
    for i in range(n//2):
        ri.append(nums[2*i])
        le.append(nums[2*i+1])
    le.reverse()
else:
    for i in range(n//2):
        ri.append(nums[2*i+1])
        le.append(nums[2*i])
    le.append(nums[n-1])
    le.reverse()
print(*le, end = " ")
print(*ri)

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

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

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

Solution (Python):
n = int(input())
arr = [int(i) for i in input().split()]
odd = []
even = []
for i in range(n):
    if i%2 == 0:
        odd.append(arr[i])
    else:
        even.append(arr[i])
even = even[::-1]
ans = even+odd if n%2 == 0 else (even+odd)[::-1]
for i in range(n):
    if i<n-1:
        print(ans[i],end=" ")
    else:
        print(ans[i])

Solution (Python):
from collections import deque
n=int(input())
a=[int(i) for i in input().split()]
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()

for i in range(n):
    if i!=n-1:
        print(b[i],end=" ")
    else:
        print(b[i])

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

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

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

    ans = a1 + a2

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

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

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

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

Solution (Python):
def abc066_c():
    n = int(input())
    a = input().split()
    b = a[1::2][::-1] + a[::2]
    print(" ".join(b[::(-1) ** (n % 2)]))


abc066_c()

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

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

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

ans = []
if n % 2 == 0:
    for e in a[n-1::-2]:
        ans.append(str(e))
    for e in a[0::2]:
        ans.append(str(e))
else:
    for e in a[n-1::-2]:
        ans.append(str(e))
    for e in a[1::2]:
        ans.append(str(e))
print(' '.join(ans))

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()
    b=a2+a1
else:
    a1.reverse()
    b=a1+a2
for i in range(n):
    print(b[i],end=" ")
print()

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

Solution (Python):
def main():
    n = int(input())
    aa = list(map(int, input().split()))
    bb = [0] * n
    i_bb = 0
    i_aa = n - 1
    while i_aa >= 0:
        bb[i_bb] = aa[i_aa]
        i_aa -= 2
        i_bb += 1
    i_aa += 1
    if i_aa < 0:
        i_aa += 2
    while i_aa < n:
        bb[i_bb] = aa[i_aa]
        i_aa += 2
        i_bb += 1
    print(' '.join(str(b) for b in bb))


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
l1=[];l2=[]
for i in range(n):
  if i%2==n%2:l1.append(l[i])
  else:l2.append(l[i])
l2.reverse()
for j in range(len(l1)):
  l2.append(l1[j])
for j in range(n):
  print(l2[j],end=' ')

Solution (Python):
input()
a=list(input().split())
print(*(a[::-2]+a[len(a)%2::2]))

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

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

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

b = [0 for _ in range(n)]
i = 0
j = n - 1

while(j >= 0):
    b[i] = a[j]
    i += 1
    j -= 2

j = 0 if j == -1 else 1

while(i < n):
    b[i] = a[j]
    i += 1
    j += 2

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

Solution (Python):
import sys

n = int(input().strip())
al = list(map(int, input().strip().split(" ")))

bl = [0] * n
diff = 1 if n % 2 == 0 else -1
mid = int(n / 2)
bl[mid] = al[0]

deps = 1
a_index = 1
while a_index < n:
    if 0 > mid - deps * diff:
        break
    bl[mid - deps * diff] = al[a_index]
    a_index += 1
    if a_index >= n:
        break

    if mid + deps * diff >= n:
        break
    bl[mid + deps * diff] = al[a_index]
    a_index += 1
    deps += 1

for b in bl:
    sys.stdout.write(str(b) + " ")

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

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

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

num = 1 - i

for i in range(num, n, 2):
    print(a[i], end=' ')

print()

Solution (Python):
from sys import stderr, setrecursionlimit
from functools import reduce
from operator import add
from collections import deque
from math import ceil
setrecursionlimit(2147483647)
def f(): return [int(i) for i in input().split()]
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(str(item))
        stderr.write(sep)
    stderr.write(end)

n = int(input())
a = f()

b = deque([a[0]])
i = 0
if n % 2 == 0:
    for i, v in enumerate(a[1:]):
        if i % 2 == 0:
            b.appendleft(v)
        else:
            b.append(v)
else:
    for i, v in enumerate(a[1:]):
            if i % 2 == 0:
                b.append(v)
            else:
                b.appendleft(v)
    
print(*b, sep=' ')

Solution (Python):
N = int(input())
A = [int(_) for _ in input().split()]
print(' '.join(map(str, (A[0::2][::-1]+A[1::2])[::2*(len(A) % 2)-1])))

Solution (Python):
n = int(input())
a = input().split()
a = [int(m) for m in a]
rea = []
for i in range(n):
    rea.append([i, a[i]])

rea.sort(reverse=True)
b = []
c = []
for i in range(n):
    if i % 2 == 0:
        b.append([rea[i][0], rea[i][1]])
    else:
        c.append([rea[i][0], rea[i][1]])

c.sort()

nb = []
nc = []
for i in range(len(b)):
    nb.append(b[i][1])
for i in range(len(c)):
    nc.append(c[i][1])
nd = nb + nc
for i in range(n):
    print(nd[i], end = ' ')