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()))
f = []
b = []
for i, j in enumerate(a):
    if (i+n)%2==0:
        f.append(j)
    else:
        b.append(j)
ans = b[::-1] + f
print(*ans)

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

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

d = [0 for _ in range(n)]

l = [i for i in input().split()]

for idx,i in enumerate(l[::-1]):
    if idx % 2 == 0:
        d[idx//2] = i
    else:
        d[-1*idx //2] = i
        
print(*d)

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

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

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

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:
    ans = l[::-1] + r
else:
    ans = r[::-1] + l
print(*ans)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
b = [-1] *N

for i in range((N+1)//2):
  b[i] = str(a[N-1-i*2])
for i in range(N //2):
  b[i+((N+1)//2)] = str(a[N%2 + 2*i])
print(" ".join(b))

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

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

Solution (Python):
from collections import deque
d = deque()

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

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

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

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


answer = arr[::2][::-1] + arr[1::2]
if not N&1:
  answer = answer[::-1]
  
print(*answer,sep=' ')

Solution (Python):
from collections import deque
dq=deque([])

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

Solution (Python):
n = int(input())
A = list(map(int,input().split()))
flag = 0
plus = [[],[]]
for a in A:
    plus[flag].append(a)
    flag ^= 1
print(' '.join(str(i) for i in plus[1 - flag][::-1] + plus[flag]))

Solution (Python):
from collections import deque

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

Solution (Python):
from collections import deque

N = int(input())
A = list(map(int, input().split()))
ans = deque([])

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

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
from collections import deque
dq=deque([])

for i in range(n):
    if i%2:
        dq.append(l[i])
    else:dq.appendleft(l[i])
print(*list(dq)[::-(-1)**(n%2)])

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

if n%2 ==0:
    mae = []
    ushiro = []
    for i in range(0,n,2):
        ushiro.append(a[i])
    for i in reversed(range(1,n,2)):
        mae.append(a[i])
    ans = mae + ushiro
    print(*ans, sep=' ')
else:
    mae = []
    ushiro = []
    for i in range(1,n,2):
        ushiro.append(a[i])
    for i in reversed(range(0,n,2)):
        mae.append(a[i])
    ans = mae + ushiro
    print(*ans, sep=' ')

Solution (Python):
from collections import deque
n=int(input())
a=input().split()
s=deque([])
for i in range(n):
    if i%2:
        s.append(a[i])
    else:
        s.appendleft(a[i])
if n%2==0:
    s.reverse()
print(str(s).replace(' ','').replace(',',' ').replace('deque([','').replace('])','\n').replace("'",''))

Solution (Python):
def main():
    N = int(input())
    A = [a for a in input().split()]
    odd = [A[i] for i in range(N) if (i+1) % 2 == 1]
    even = [A[i] for i in range(N) if (i+1) % 2 == 0]

    if len(A) % 2 == 1:
        print(*(odd[::-1]+even))
    else:
        print(*(even[::-1]+odd))
if __name__ == "__main__":
    main()

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

a_odd = a[0::2]
a_even = a[1::2]

if N %2 == 0:
  print(" ".join(list(map(str,list(reversed(a_even)) + a_odd))))
else:
  print(" ".join(list(map(str,list(reversed(a_odd)) + a_even))))

Solution (Python):
from collections import deque
def myAnswer(N:int,A:list) -> None:
   ans = deque()
   for n,a in enumerate(A):
      if((n + 1)% 2==0):
         ans.append(str(a))
      else:
         ans.appendleft(str(a))
   if(N % 2 == 0):
      ans = reversed(ans)
   print(" ".join(ans))

def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   myAnswer(N,A[:])
if __name__ == '__main__':
   main()

Solution (Python):
from collections import deque,Counter

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

B = deque()

flg = True
for a in arrA:
    if flg:
        B.append(a)
    else:
        B.appendleft(a)
    flg = not flg
if not flg:
    B.reverse()

print(*B)

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

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

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

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

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
if n%2==0:
  a = l[1::2][::-1]
  b = l[::2]
  for i in a:
    print(i,end=' ')
  for j in b:
    print(j,end=' ')
  
else:
  a = l[0::2][::-1]
  b = l[1::2]
  for i in a:
    print(i,end=' ')
  for j in b:
    print(j,end=' ')

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
b = []
c = []
flag = True
for i in range(n):
    if flag:
        b.append(a[i])
        flag = False
    else:
        c.append(a[i])
        flag = True
if flag:
    c.reverse()
    ans = c+b
else:
    b.reverse()
    ans = b+c
for i in range(n):
    print(ans[i], end=" ")
print()

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

Solution (Python):
from collections import deque

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

if n % 2 == 0:
    flg = True
else:
    flg = False

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

na = list(na)
if flg:
    for el in na:
        print(el, end=" ")
else:
    for el in reversed(na):
        print(el, end=" ")

Solution (Python):
from collections import deque

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

if n % 2 == 0:
    flg = True
else:
    flg = False

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

na = list(na)
if flg:
    for el in na:
        print(el, end=" ")
else:
    for el in reversed(na):
        print(el, end=" ")

Solution (Python):
from collections import deque

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

d=deque()

odd = True

for i, aa in enumerate(a):
    if odd:
        d.append(str(aa))
        odd = False
    else:
        d.appendleft(str(aa))
        odd = True

if odd == False:
    d = list(d)[::-1]
ans = ' '.join(d)
print(ans)

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

Solution (Python):
n = int(input())
import queue
dq = queue.deque()
a_list = list(map(int,input().split()))

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

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

Solution (Python):
def resolve():
    N = int(input())
    A = input().split()
    import collections
    deq = collections.deque()
    addleft = True if N%2==1 else False
    for a in A:
        if addleft:
            deq.appendleft(a)
        else:
            deq.append(a)
        addleft = (not addleft)
    print(" ".join(deq))

if '__main__' == __name__:
    resolve()

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):
n=int(input())
a=list(map(int,input().split()))

from collections import deque    
q = deque([])

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

Solution (Python):
from collections import deque
def main():
    n, a, b = int(input()), list(map(int, input().split())), deque()
    append, appendleft = b.append, b.appendleft
    flag = True
    for el in a:
        if flag: append(el)
        else: appendleft(el)
        flag = not flag
    if not flag: b.reverse()
    print(" ".join(list(map(str, b))))
main()

Solution (Python):
from collections import deque
n, a, b = int(input()), list(map(int, input().split())), deque()
append, appendleft = b.append, b.appendleft
flag = True
for i in range(n):
    if flag: append(a[i])
    else: appendleft(a[i])
    flag = not flag
if not flag: b.reverse()
print(" ".join(list(map(str, b))))

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

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

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

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
b = [0 for _ in range(n)]
i = n-1
j = 0
while True:
    b[j] = a[i]
    if i-2 < 0:
        j += 1
        break
    j += 1
    i -= 2
if n%2==0:
    i = 0
else:
    i = 1
while i < n:
    b[j] = a[i]
    j += 1
    i += 2
        
print(*b)

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

def main():
    N = int(readline())
    A = list(map(int, readline().rstrip().split()))
    que = deque([])
    for i, a in enumerate(A):
        if i % 2 == 0:
            que.append(a)
        else:
            que.appendleft(a)
    
    if N % 2 == 1:
        que = list(que)[::-1]
    print(*que)


if __name__ == '__main__':
    main()

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

gu_li = []
ki_li = []
for i in range(0,n):
    if i%2 == 1:
        gu_li.append(li[i])
    else:
        ki_li.append(li[i])

ans = []
if n % 2 == 0:
    ans += list(reversed(gu_li)) + ki_li
else:
    ans += list(reversed(ki_li)) + gu_li

print(*ans)

Solution (Python):
from collections import deque

n = int(input())
a = list(map(int, input().split()))
b = deque()
for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.appendleft(a[i])

if n % 2 != 0:
    for i in reversed(b):
        print(i, end=" ")
else:
    for i in b:
        print(i, end=" ")

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 == 0:
    for i in range(n):
        print(b[i], end=' ')
else:
    for i in reversed(range(n)):
        print(b[i], end=' ')

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

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

print(*ans)

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

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

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

def print_data(a, flag):
    for i in range(n - 1, -1, -2):
        print(a[i], end = " ")
    
    for i in range(0 + flag, n, 2):
        print(a[i], end = " ")
    
    print()


if n % 2 == 0:
    print_data(a, 0)
else:
    print_data(a, 1)

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

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

if r:
    b = reversed(b)
ans = ' '.join(b)
print(ans)

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
n = int(input())
a = list(map(int,input().split()))

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

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

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

Solution (Python):
data = int(input())
array = list(map(int, input().split()))
array=array[::-1]
x=array[::2]
y=array[1::2]
b=x+y[::-1]
print(*b, sep=" ")

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

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

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

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

Solution (Python):
import collections
def slove(n, a):
    b = collections.deque()

    for i, x in enumerate(a):
        if i % 2 == 0:
            b.append(x)
        else:
            b.appendleft(x)
    if n % 2 == 0:
        return " ".join(b)
    else:
        return " ".join(reversed(b))

if __name__ == "__main__":
    n = int(input())
    a_list = [i for i in input().split()]
    print(slove(n, a_list))

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

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

Solution (Python):
n= int(input())
*a,=map(int, input().split( ))
flag = True

b1 = []
b2 = []

for i in range(n):
    if flag:
        b1.append(a[i])
    else:
        b2.append(a[i])
    flag ^= 1
b2.reverse()
ans = b2+b1
if not flag:
    ans.reverse()
print(*ans)

Solution (Python):
from collections import deque

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

b = deque()

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

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

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

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

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

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
b1 = []
b2 = []
for i in range(n):
    if i % 2 == 0:
        b1.append(a[i])
    else:
        b2.append(a[i])
if n % 2 == 0:
    b2.reverse()
    b = b2 + b1
else:
    b1.reverse()
    b = b1 + b2
    
print(' '.join(map(str, 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])
    if i % 2 == 1:
        c.append(a[i])
c.reverse()
c += b
if n % 2 == 1:
    c.reverse()
print(*c)

Solution (Python):
from collections import deque
n, *A = map(int, open(0).read().split())
B = deque()

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

Solution (Python):

from collections import  deque
n = int(input())
lst = list(input().split())
reverse = False
b = deque()
for a in lst:
	if reverse:
		b.appendleft(a)
	else:
		b.append(a)
	reverse = not reverse

answer =[]
if reverse:
	while b:
		answer.append(b.pop())
else:
	while b:
		answer.append(b.popleft())

print(" ".join(answer))

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

Solution (Python):
from collections import deque

n = int(input())
a = list(map(int, input().split()))
s = deque([])

for i in range(n):
    if i%2==1:
        s.appendleft(a[i])
    else:
        s.append(a[i])
if n%2 == 1:
    s.reverse()
print(*s)

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

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

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

if len(A) == 1:
    print(A[0])
    exit(0)

B_left = []
B_right = []
for i, a in enumerate(A):
    if i % 2 == 0:
        B_right.append(a)
    else:
        B_left.append(a)

if len(A) % 2 == 0:
    B = B_left[::-1] + B_right
else:
    B = B_right[::-1] + B_left
print(*B)

Solution (Python):

url = "https://atcoder.jp//contests/abc066/tasks/arc077_a"

def main():
    input()
    t = list(map(int, input().split()))
    left = []
    right = []
    ans = [0] * len(t)
    for i in range(len(t)):
        if (len(t) - (i + 1) ) % 2 == 0:
            left.append(t[i])
        else:
            right.append(t[i])
    print(' '.join([str(v) for v in left[::-1]]), ' '.join([str(v) for v in right]))


if __name__ == '__main__':
    main()

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

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

Solution (Python):
from collections import deque
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(*(list(reversed(l))+r))
else:
  print(*(list(reversed(r))+l))

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

for i in range(n):
    if (i+1)%2==0:
        R.append(a[i])
    else:
        L.append(a[i])



if n%2==0:
    R.reverse()
    print(*R+L)
else:
    L.reverse()
    print(*L+R)

Solution (Python):
import sys
from collections import deque

n, *a = map(int, sys.stdin.read().split())

def main():
    b = deque()
    for i in range(n):
        if (i & 1): b.appendleft(a[i])
        else: b.append(a[i])
    if (n & 1): b.reverse()
    print(*b, sep=' ')

if __name__ ==  '__main__':
    main()

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

Solution (Python):
n=int(input())
a=list(map(int, input().split()))
a_gu=a[0::2]
a_ki=a[1::2]
if len(a)%2==0:
    a_ki.reverse()
    a_ki.extend(a_gu)
    print(' '.join(map(str,a_ki)))
else:
    a_gu.reverse()
    a_gu.extend(a_ki)
    print(' '.join(map(str,a_gu)))

Solution (Python):
n = int(input())
a= list(map(int, input().split()))
from collections import deque
d=deque()
if n%2==0:
    flag=1
else:
    flag=-1
for i in a:
    if flag==1:
        d.append(i)
        flag*=-1
    else:
        d.appendleft(i)
        flag*=-1
for i in d:
    print(i,end=" ")
print()

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

for i,x in enumerate(a):
    if i%2==1:
        b.appendleft(x)
    else:
        b.append(x)
if n%2==1:
    for i in list(b)[::-1]:
        print(i)
else:
    for i in b:
        print(i)

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

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

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

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

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

if n >= 2:
  print(' '.join(d))
else:
  print(a[0])

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
fw = [a for i,a in enumerate(A) if i%2 == 0]
bw = [a for i,a in enumerate(A) if i%2 == 1]
if len(A) % 2 == 0:
  ans = list(reversed(bw)) + fw
else:
  ans = list(reversed(fw)) + bw
print(' '.join([str(a) for a in ans]))

Solution (Python):
n,*a=map(int,open(0).read().split())
if len(a)%2:
  print(' '.join(map(str,a[::-2]+a[1::2])))
else:
  print(' '.join(map(str,a[::-2]+a[::2])))

Solution (Python):
from collections import deque
b = deque()
n = int(input())
ns = map(int, input().split())
for i, j in enumerate(ns):
    if i%2 == 0:
        b.append(j)
    else:
        b.appendleft(j)
b = list(map(str, b))
if i%2 == 0:
    b = b[::-1]
    print(' '.join(b))
else:
    print(' '.join(b))

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def ini():
  fac[0] = 1 % mod
  for i in range(1,N):
    fac[i] = fac[i-1] * i % mod"""

"""mod = 1e9+7
N = 10000000
pw = [0] * N
def ini(c):
  pw[0] = 1 % mod
  for i in range(1,N):
    pw[i] = pw[i-1] * c % mod"""

"""
def YEILD():
  yield 'one'
  yield 'two'
  yield 'three'
generator = YEILD()
print(next(generator))
print(next(generator))
print(next(generator))
"""
"""def gcd_(a,b):
  if b == 0:
    return a
  return gcd_(a,a % b) 
"""def extgcd(a,b,x,y):
  d = a
  if b!=0:
    d = extgcd(b,a%b,y,x)
    y -= (a//b) * x
    print(x,y)
  else:
    x = 1
    y = 0
  return d"""


def readInts():
  return list(map(int,input().split()))
mod = 10**9 + 7
def main():
  n = int(input())
  *A, = map(int,input().split()) 
  from collections import deque
  B = deque([]) 
  for i,a in enumerate(A):
    if i % 2 == 0:
      B.append(a)
    else:
      B.appendleft(a)
  if n % 2 == 1:
    B.reverse() 
  print(*B)
if __name__ == '__main__':
  main()

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

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

Solution (Python):
n = int(input())
a = list(map(str,input().split()))
b = a[::-1]
b = b[::2]
if n%2 == 0:
  c = a[::2]
else:
  c = a[1::2]
d = b+c
if n >= 2:
  print(' '.join(d))
else:
  print(a[0])

Solution (Python):
from collections import deque
n = int(input())
A = input().split()
ans = deque()
cnt = 1
for a in A:
    if cnt%2==n%2: ans.appendleft(a)
    else: ans.append(a)
    cnt+=1
print(' '.join(ans))

Solution (Python):
N = int(input())
ARR = [int(s) for s in input().split(" ")]
def calculate(n,arr):

    left = list([])
    right = list([])
    if n % 2 == 0:
        for index,ar in enumerate(arr):
            if index % 2 == 0:
                right.append(str(ar))
            else:
                left.append(str(ar))
    else:
        for index,ar in enumerate(arr):
            if index % 2 == 0:
                left.append(str(ar))
            else:
                right.append(str(ar))

    left.reverse()
    left.extend(right)

    return left

result = calculate(N,ARR)
print(" ".join(result))

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):
n, *a_l = map(int, open(0).read().split())
b = []

for a in a_l[::-2]:
        b.append(a)
for a in a_l[n%2::2]:
        b.append(a)

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

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

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

Solution (Python):
from collections import deque
queue=deque()

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

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

answer = []
if n % 2 == 1:
  for i in range(n):
    answer.append(queue.pop())
else:
  for i in range(n):
    answer.append(queue.popleft())
    
print(*answer)