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

a = list(range(1,N+1,2))
b = list(range(2,N+1,2))

if N%2 == 0:
    b.reverse()
    ind = b + a
else:
    a.reverse()
    ind = a + b

ans = []
for i in ind:
    ans.append(A[i-1])

print(*ans)

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

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

Solution (Python):
from queue 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])

ans = list(b)

if n%2 != 0:
    ans = ans[::-1]

print(*ans)

Solution (Python):
from collections import deque
 
N = int(input())
numbers = input().split()
 
d = deque()
 
for i in range(N):
    if i % 2 == 0:
        d.append(numbers[i])
    else :
        d.appendleft(numbers[i])
        
if N % 2 == 1:
    d.reverse()
    
output = ' '.join(d)
 
print(output)

Solution (Python):
import sys

from collections import Counter, deque

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = deque(list(map(int, input().split())))
    B = deque([])

    if n % 2 == 0:
        for i in range(n):
            a = deque.popleft(A)
            if i % 2 == 0:
                B.append(a)
            else:
                B.appendleft(a)
    else:
        for i in range(n):
            a = deque.popleft(A)
            if i % 2 != 0:
                B.append(a)
            else:
                B.appendleft(a)
    print(" ".join(map(str, B)))


if __name__ == '__main__':
    resolve()

Solution (Python):
import sys
from collections import Counter
from collections import deque
import math
import fractions
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
a=list(map(str,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=reversed(ans)
print(*ans)

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

ok = True
for i in range(n):
  if ok:
    b.append(a[i])
    ok = False
  else:
    b.appendleft(a[i])
    ok = True

b = list(map(str, list(b)))
if ok:
  print(" ".join(b))
else:
  print(" ".join(b[::-1]))

Solution (Python):
from collections import deque

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

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

print(*ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
 
if n % 2 == 0:
    for i in reversed(range(1, n, 2)):
        print(a[i],end=" ")
    for i in range(0,n-1,2):
        print(a[i],end=" ")
elif n % 2 == 1:
    for i in reversed(range(0, n, 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()))
que = deque()

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

Solution (Python):
from collections import deque

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

for i in range(n):
    if i % 2 == 0:
        que.appendleft(A[i])
    else:
        que.append(A[i])
else:
    if n % 2 == 0:
        que.reverse()
    lis = list(map(lambda x:str(x),que))
    print(" ".join(lis))

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

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

res = [0]*n
m = n //2

if n % 2 ==0:
    for i in range(m):
        res[i] = al[-1-i*2]    
    for j in range(m):
        res[m+j]= al[j*2]
           
else:
    for i in range(m+1):
        res[i] = al[-1-i*2]
    for j in range(m):
        res[m+1+j] = al[1+j*2]


ress=""
for k in range(n):
    ress +=str(res[k])
    ress +=" "

print(ress[:-1])

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    a=list(input().split())
    akisu=a[0::2]
    agusu=a[1::2][::-1]
    b=agusu+akisu
    if n%2==0:
        print(*b)
    else:
        print(*b[::-1])
resolve()

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

odd = A[0::2]
even = A[1::2][::-1]

ans = even + odd

if n % 2 == 1:
    ans = ans[::-1]
    
print(*ans)

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

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

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

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

B = []
for i in index:
    B.append(str(A[i]))
print(' '.join(B))

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

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

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

b = []

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

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

print(' '.join(b))

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

for i in range(n):
    print(b[i], end=' ')

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n = n//a
    count += 1
  if a**count == n:
    return count
  else:
    return count+1





N = I()
A = IL()

iti = A[::2]
ni = A[1::2]

if N % 2:
  print(*((ni[::-1]+iti)[::-1]),sep=" ")
else:
  print(*(ni[::-1]+iti),sep=" ")

Solution (Python):
from collections import deque

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

reverse = False

ans = deque()
for i in a:
    if reverse:
        ans.appendleft(i)
    else:
        ans.append(i)
    reverse = not reverse

print(*reversed(ans)) if reverse else print(*ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
b1 = a[::2]
b2 = a[1::2]
if n % 2 == 1:
    b1 = b1[::-1]
    b1.extend(b2)
    b = b1
else:
    b2 = b2[::-1]
    b2.extend(b1)
    b = b2
print(*b, sep=' ')

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

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

ans = left + right

print(*ans)

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!=0:
    b=even[::-1]+odd
else:
    b=odd[::-1]+even

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

Solution (Python):
N,*A=map(int,open(0).read().split())
print(*A[N-1::-2]+A[N&1::2])

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
odd = []
even = []
o = 0
e = 1
while o < n:
  odd.append(str(a[o]))
  o += 2
while e < n:
  even.append(str(a[e]))
  e += 2
if n%2 == 0:
  ans = even[::-1]+odd
else:
  ans = odd[::-1]+even
print(' '.join(ans))

Solution (Python):
from collections import deque

N = int(input())
A = map(int, input().split())
B = deque()
flag = 0
for a in A:
  if flag:
    B.appendleft(a)
  else:
    B.append(a)
  flag = 1 - flag

B = list(B)
if flag:
  print(*B[::-1])
else:
  print(*B)

Solution (Python):
N = int(input())
A = list(input().split())
odd = []
even = []

for i in range(N):
    if i % 2 == 1:
        odd.append(A[i])
    else:
        even.append(A[i])

if N % 2 == 0:
    odd = odd[::-1]
    odd.extend(even)
    ans = odd
else:
    even = even[::-1]
    even.extend(odd)
    ans = even

print(" ".join(ans))

Solution (Python):

import sys
from collections import deque
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    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])
    l=list(q)
    if n%2:
        l.reverse()
    print(*l)

if __name__ == '__main__':
    main()

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

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

Solution (Python):
from collections import deque

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

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

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

print(*b)

Solution (Python):
import sys
import os

def file_input():
    f = open('ABC066/input.txt', 'r')
    sys.stdin = f

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

    out=[""]*n

    for i in range(n):
        if i%2==0:
            out[n//2+i//2]=str(a[i])
        else:
            out[n//2-(-(-i//2))]=str(a[i])
    if n%2!=0:
        out.reverse()

    print(*out)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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

    N = ii()
    A = il()
    ret = collections.deque()

    for n in range(N):
        if N % 2 == (n+1) % 2:
            ret.appendleft(A[n])
        else:
            ret.append(A[n])
    print(*ret)


if __name__ == '__main__':
    main()

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

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

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

print(*b)

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

frn = ["" for i in range((n+1)//2)]
bck = ["" for i in range(n//2)]

for i in range(n):
    if i%2 == 0:
        frn[i//2] = a[i]
    else:
        bck[i//2] = a[i]

if n%2 == 0:
    print(" ".join(bck[::-1]+frn))
else:
    print(" ".join(frn[::-1]+bck))

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

if __name__ == '__main__':
    main()

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = iil()

tail = [item for i,item in enumerate(A) if i%2 == 0]
head = [item for i,item in enumerate(A) if i%2 == 1]
ans = head[::-1]+tail if n%2 == 0 else tail[::-1]+head
print(*ans)

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

ans_li=[]
if n%2==0:
    for i in range(n,0,-2):
        ans_li.append(a_input[i-1])
    for i in range(1,n,2):
        ans_li.append(a_input[i-1])
else:
    for i in range(n,0,-2):
        ans_li.append(a_input[i-1])
    for i in range(2,n,2):
        ans_li.append(a_input[i-1])
print(' '.join(map(str,ans_li)))

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

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

Solution (Python):
from collections import deque
n = int(input())
a = input().split()
b = deque()
f = True
for ai in a:
    if f:
        b.appendleft(ai)
    else:
        b.append(ai)
    f = not f
if f:
    b.reverse()
    print(" ".join(b))
else:
    print(" ".join(b))

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

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

print(*solve())

Solution (Python):
from collections import deque

input()
values = tuple(input().split(' '))

queue = deque()

for index, value in enumerate(values):
    if index % 2 == 0:
        queue.append(value)
    else:
        queue.appendleft(value)

if len(values) % 2 == 1:
    queue.reverse()

print(' '.join(queue))

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

before_turn = []
for i in reversed(A[1::2]):
    before_turn.append(i)

for i in A[::2]:
    before_turn.append(i)


if N % 2 == 0 or N == 1:
    print(" ".join(map(str, before_turn)))
else:
    turn = before_turn[::-1]
    print(" ".join(map(str, turn)))

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

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

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

print(' '.join(d))

Solution (Python):

"""
Created on Wed May 13 13:11:09 2020

@author: shinba
"""
from collections import deque

n = int(input())

reverse = False

B = deque([])

for i in map(int,input().split()):
    if not reverse:
        B.append(i)
        reverse = True
    else:
        B.appendleft(i)
        reverse = False
        
if not reverse:
    print(" ".join(map(str,B)))
else:
    B.reverse()
    print(" ".join(map(str,B)))

Solution (Python):
from collections import deque
 
N = int(input())
numbers = input().split()
 
d = deque()
 
for i in range(N):
    if i % 2 == 0:
        d.append(numbers[i])
    else :
        d.appendleft(numbers[i])
        
if N % 2 == 1:
    d.reverse()
    
output = ' '.join(d)
 
print(output)

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

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

print(*B)

Solution (Python):
from collections import deque

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

d = deque()

for i in range(N):
    if i % 2 == 0:
        d.append(numbers[i])
    else :
        d.appendleft(numbers[i])
        
if N % 2 == 1:
    d.reverse()
    
output = ' '.join(d)

print(output)

Solution (Python):
from collections import deque

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

d = deque()

for i in range(N):
    if i % 2 == 0:
        d.append(numbers[i])
    else :
        d.appendleft(numbers[i])
        
if N % 2 == 1:
    d.reverse()
    
output = ' '.join(d)

print(output)

Solution (Python):

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

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

if (n - 1) % 2 == 1:
    [print(ans, end = " ") for ans in list(b)[::-1]]
else:
    [print(ans, end = " ") for ans in list(b)]

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

for i, k in enumerate(a):
    if i % 2 == 0:
        b[n // 2 + (i + 1) // 2] = k
    else:
        b[n // 2 - (i + 1) // 2] = k

if n % 2 == 1:
    print(' '.join([str(k) for k in b[::-1]]))
else:
    print(' '.join([str(k) for k in b]))

Solution (Python):


from collections import deque
n = int(input())
nums = [int(i) for i in input().split()]

ans = deque()
rev = False
for i in range(n):
    if rev:
        ans.appendleft(nums[i])
        rev = False
    else:
        ans.append(nums[i])
        rev = True
if rev:
    ans = reversed(ans)
print(*ans)

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

Solution (Python):
import math
N = int(input())
x = list(map(int, input().split()))
y = []
if N%2 == 0:
    for i in range(N//2):
        y.append(x[N-1-2*i])
    for i in range(N//2):
        y.append(x[2*i])
if N%2 == 1:
    for i in range(math.ceil(N/2)):
        y.append(x[N-1-2*i])
    for i in range(math.floor(N/2)):
        y.append(x[2*i+1])
print(*y)

Solution (Python):
n = int(input())
a = input().split()
a_odd = a[1::2]
a_even = a[0::2]

if n % 2 == 0:
    a_odd.reverse()
    ans = a_odd + a_even
else:
    a_even.reverse()
    ans = a_even + a_odd
print(' '.join(ans))

Solution (Python):
from collections import deque


def resolve():
	n = int(input())
	a = list(map(int, input().split()))
	d = deque()
	is_even = True if n % 2 == 0 else False
	for i in range(n):
		if is_even:
			if (i+1) % 2 == 0:
				d.appendleft(a[i])
			else:
				d.append(a[i])
		else:
			if (i+1) % 2 == 0:
				d.append(a[i])
			else:
				d.appendleft(a[i])

	print(" ".join(list(map(str, d))))
resolve()

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

Solution (Python):
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions
import functools
import copy





sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))




def main():
    n = ni()
    a = na()

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

    odd.reverse()
    odd.extend(even)

    if len(a)%2:
        odd.reverse()

    print(*odd, sep=" ")



if __name__ == '__main__':
    main()

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

Solution (Python):
import sys

input = sys.stdin.readline


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

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


if __name__ == "__main__":
    main()

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

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

print(" ".join(b))

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from collections import deque

n, *a = map(int, read().split())
b = deque()
v = 1 if n % 2 == 0 else 0
for i, aa in enumerate(a):
    if i % 2 == v:
        b.appendleft(aa)
    else:
        b.append(aa)
print(*b)

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

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

ans = deque()

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

print(*ans)

Solution (Python):
from collections import deque
N = int(input())
A = tuple(map(int, input().split()))
B = deque([])
for i in range(N):
    if i & 1:
        B.appendleft(A[i])
    else:
        B.append(A[i])
if N & 1:
    print(*reversed(B))
else:
    print(*B)

Solution (Python):
import collections

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

Solution (Python):
N = int(input())
A = [int(x) for x in input().split()]
if N&1:
    ans = A[::2][::-1] + A[1::2]
else:
    ans = A[1::2][::-1] + A[::2]
print(*ans)

Solution (Python):
from collections import deque
N = int(input())
A = [int(x) for x in input().split()]
if N%2==0:
    queue = deque()
    for i in range(0, N, 2):
        queue.append(A[i])
        queue.appendleft(A[i+1])
else:
    queue = deque([A[0]])
    for i in range(1, N, 2):
        queue.append(A[i])
        queue.appendleft(A[i+1])

print(*queue)

Solution (Python):
N = int(input())
A = [int(x) for x in input().split()]
A = [0] + A
B = []

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

print(*B)

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

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

half = int(n/2)
for i in range(1,n+1):
    t = i%2
    if t != 0:
        b[half+int(i/2)] = a[i-1]
    else:
        b[half-int(i/2)] = a[i-1]

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

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

a1 = a[::2]
a2 = a[1::2]

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

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7



def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    B = [0]*N
    index = 0
    for i in range(N)[::-1]:
        if index <0:
            B[index] = A[i]
            index *= -1
        else:
            B[index] = A[i]
            index = -index -1
    print(' '.join(map(str, B)))
if __name__ == '__main__':
    main()

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

a1 = list(map(str, a[::2]))
a2 = list(map(str, a[1::2]))

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

Solution (Python):
from collections import deque
def main3():
    d = deque()
    rd= deque()
    N = int(input().strip())
    for n in input().split():
        if len(rd)%2!=0:
            d.append(n)
            rd.appendleft(n)
        else:
            rd.append(n)
            d.appendleft(n)
    if N % 2 ==0:
        print(*rd)
    else:
        print(*d)

if __name__ == "__main__":
    main3()

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

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

n = int(input())
a = list(map(int,input().split()))
ans = ""
d = collections.deque()
for i in range(n):
    if i%2 == 1:
        d.append(a[i])
    else:
        d.appendleft(a[i])
ans = []
if n%2 == 1:
    for i in range(n):
        ans.append(d[i])
else:
    for i in range(n):
        ans.append(d[n-i-1])
print(*ans)

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

answer_list=[]
for i in range(n-1,-1,-2):
  answer_list.append(alist[i])
if n%2==0:
  for i in range(0,n,2):
    answer_list.append(alist[i])
else:
  for i in range(1,n,2):
    answer_list.append(alist[i])
    
print(*answer_list)