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


if N % 2 == 1:
    b = [a[i] for i in range(len(a)) if i % 2 == 0][::-1]
    c = [a[i] for i in range(len(a)) if i % 2 == 1]
    ans = list(map(str, b + c))
    print(" ".join(ans))
else:
    b = [a[i] for i in range(len(a)) if i % 2 == 1][::-1]
    c = [a[i] for i in range(len(a)) if i % 2 == 0]
    ans = list(map(str, b + c))
    print(" ".join(ans))

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

new_a = [0 for x in range(N)]

sw = False 
cnt = 0

for i in range(N) :
    new_a[cnt] = a[N - i - 1]
    if sw == False :
        cnt = N - cnt - 1
        sw = True
    else :
        cnt = -(cnt - N + 1) + 1
        sw = False
    
print(" ".join(map(str,new_a)))

Solution (Python):



from collections import deque

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

bN = deque()
if N % 2 == 0:
    for i in range(N):
        if i % 2 == 0:
            bN.append(str(aN[i]))
        else:
            bN.appendleft(str(aN[i]))
else:
    for i in range(N):
        if i % 2 == 1:
            bN.append(str(aN[i]))
        else:
            bN.appendleft(str(aN[i]))

print(" ".join(bN))

Solution (Python):


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

bN = [0] * N
if N % 2 == 0:
    for i in range(N):
        if i % 2 == 0:
            bN[(N//2) + i//2] = str(aN[i])
        else:
            bN[(N//2) - (i+1)//2] = str(aN[i])
else:
    for i in range(N):
        if i % 2 == 0:
            bN[(N//2) - i//2] = str(aN[i])
        else:
            bN[(N//2) + (i+1)//2] = str(aN[i])

print(" ".join(bN))

Solution (Python):

N=int(input())

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

ans = []


for i in range(N-2,N%2-1,-2):
    ans.append(str(a[i]))
    
for i in range((N-1)%2,N,2):
    ans.append(str(a[i]))

ans.reverse()

print(' '.join(ans))

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

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

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

Solution (Python):
from collections import deque
n = int(input())
a = list(map(int,input().split()))
appLeft = n%2!=0
i = 0
ans = deque()
while i < n:
    if appLeft:
        ans.appendleft(a[i])
    else:
        ans.append(a[i])
    appLeft = not appLeft
    i+=1
print(" ".join(list(map(str,list(ans)))))

Solution (Python):


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

if n % 2 == 0:
    left = sorted([i*2+1 for i in range(n//2)], reverse=True)
    for i in range(len(left)):
        left[i] = A[left[i]]
    print(' '.join(list(map(str, left)) + [str(A[j*2]) for j in range(n//2)]))
else:
    left = sorted([i*2+2 for i in range(n//2)], reverse=True)
    for i in range(len(left)):
        left[i] = A[left[i]]
    print(' '.join(list(map(str, left)) + [str(A[0])] + [str(A[j*2+1]) for j in range(n//2)]))

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

l=[int(i) for i in input().split()]
res=[]
for i in range(-1,-n-1,-2):
    res.append(l[i])
for i in range(0+n%2,n,2):
    res.append(l[i])

print(*res)

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

Solution (Python):

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

for i in range(n - 1, (n + 1) % 2 - 1, -2):
    print(A[i], end = " ")
for j in range(n % 2, n - 1, 2):
    print(A[j], end = " ")

Solution (Python):

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

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

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

r = [0] * N
x = 0
for i in range(N):
    r[x] = A[-i-1]
    x = N - 1 - x
    if x * 2 < N:
        x += 1

print(*r)

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

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

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

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

Solution (Python):
from collections import deque

n = int(input())

result = deque()
index = 0

def front_enque(i):
    global result, index
    result.appendleft(i)
    index += 1

def enque(i):
    global result, index
    result.append(i)
    index += 1

if n % 2 == 0:
    for i in input().split():
        if index % 2 == 1:
            front_enque(i)
        else:
            enque(i)
else:
    for i in input().split():
        if index % 2 == 1:
            enque(i)
        else:
            front_enque(i)

print(" ".join(result))

Solution (Python):
from collections import deque

n = int(input())

result = deque()
index = 0

if n % 2 == 0:
    for i in input().split():
        if index % 2 == 1:
            result.appendleft(i)
            index += 1
        else:
            result.append(i)
            index += 1
else:
    for i in input().split():
        if index % 2 == 1:
            result.append(i)
            index += 1
        else:
            result.appendleft(i)
            index += 1

print(" ".join(result))

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

Solution (Python):
N = int(input())
src = list(map(int,input().split()))
ans =  list(reversed(src[(N+1)%2::2])) + src[N%2::2]
print(*ans)

Solution (Python):
def getinputdata():

    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
arr = arr_data[1]

arr1=[]
for i in range(n-1,-1,-2):
    arr1.append(arr[i])
    
sposi=0 if n % 2==0 else 1

for j in range(sposi,n,2):
    arr1.append(arr[j])

print(" ".join(arr1))

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

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

    to_str = map(str, ans)
    return " ".join(to_str)

print(main())

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

Solution (Python):
n = int(input())
a = list(map(str, input().split()))
b = a[::-2] + a[len(a)%2::2]
print(' '.join(b))

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

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

Solution (Python):
n = int(input())
a = list(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:
    even, odd = odd, even
even.reverse()
print(" ".join(even) + " " + " ".join(odd))

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

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

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

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

Solution (Python):
from collections import deque

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

print(" ".join(b))

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

if n % 2 == 0:
  ans = b[::-1] + a
  print(' '.join(map(str, ans)))
else:
  ans = a[::-1] + b
  print(' '.join(map(str, ans)))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(n)]

b[n//2] = a[0]
idx = n - 1
for i in range(0, n//2):
    b[i] = a[idx]
    idx -= 2

idx = 1 + (n+1) % 2
for i in range(n//2+1, n):
    b[i] = a[idx]
    idx += 2

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

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

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
B = []
C = []
for k in range(N):
    if k%2 == 0:
        B.append(A[k])
    else:
        C.append(A[k])

if N%2 == 0:
    print(" ".join(map(str, C[::-1]+B)))
else:
    print(" ".join(map(str, B[::-1]+C)))

Solution (Python):
n = int(input())
ll = list(map(int,input().split()))
mm = []
pp = n
i = 0
for i in range(n):
    try:
        mm.append(str(ll[-1-2*i]))
        ll[-1-2*i] = '-1'
    except:
        pass

    
for i in range(len(ll)):
    if ll[i] != '-1':
        mm.append(str(ll[i]))
    else:
        None
        
sss = ''
for i in mm:
    print(i, end= ' ')

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

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

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

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

n_int = map(str, b)
answer = " ".join(n_int)
print(answer)

Solution (Python):
N = int(input())
src = list(map(int,input().split()))
ans = list(reversed(src[(N+1)%2::2])) + src[N%2::2]
print(*ans)

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

Solution (Python):
N=int(input())
s=list(input().split())
t=s[N::-2]+s[N%2::2]
for i in range(N):
    print(t[i],end=" ")

Solution (Python):
N=int(input())
s=list(input().split())
if N>=2:
    t=s[N::-2]+s[N%2::2]
    for i in range(N):
        print(t[i],end=" ")
else:
    print(s[0])

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

i=n-1
while i>=0:
    b.append(a[i])
    i-=2

i=n%2
while i<n:
    b.append(a[i])
    i+=2

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

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

Solution (Python):
def unzip(n, a):
    even_pos = [elem for i, elem in enumerate(a) if i % 2 == 0]
    odd_pos = [elem for i, elem in enumerate(a) if i % 2 == 1]
    if n % 2 == 0:
        return odd_pos[::-1] + even_pos
    else:
        return even_pos[::-1] + odd_pos


if __name__ == '__main__':
    n = int(input())
    a = list(map(int, (input().split())))
    print(' '.join(map(str, unzip(n, a))))

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

Solution (Python):
def c_pushpush(N,A):
    from collections import deque
    
    b = deque([])
    n_parity = N & 1
    for i in range(N):
        if n_parity == (i + 1) & 1:
            
            b.appendleft(A[i])
        else:
            b.append(A[i])
    ans = ' '.join(map(str,b))
    return ans

N = int(input())
A = [int(i) for i in input().split()]
print(c_pushpush(N,A))

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

Solution (Python):
from collections import deque

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

b = deque([])

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

print(' '.join(list(b)))

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
if len(a)%2==0:
	for i in range(len(a)-1,-1,-2):
		print(a[i],end=" ")
	for j in range(0,len(a),2):
		if j == len(a)-2: print(a[j])
		else: print(a[j],end=" ")
else:
	for i in range(len(a)-1,-2,-2):
		print(a[i],end=" ")
	for j in range(1,len(a),2):
		if j == len(a)-2: print(a[j])
		else: print(a[j],end=" ")

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

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

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

cnt=n-1
while cnt>=0:
  ans.append(A[cnt])
  cnt-=2
if cnt==-2:
  cnt=1
else:
  cnt=0
while cnt<=n-1:
  ans.append(A[cnt])
  cnt+=2

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

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
a.insert(0,0)
b = []
if n%2==0:
	i=n
	while i>=2:
		b.append(a[i])
		i += -2
	k=1
	while k<=n-1:
		b.append(a[k])
		k += 2
else:
	i=n
	while i>=1:
		b.append(a[i])
		i += -2
	k=2
	while k<=n-1:
		b.append(a[k])
		k+=2
for i in range(n-1):
	print(b[i],end=' ')
print(b[n-1])

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:
  ans = odd[::-1] + even
else:
  ans = even[::-1] + odd
ans = map(str, ans)
print(' '.join(ans))

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


outp=str(b[0])
for i in range(1,len(b)):outp+=" "+str(b[i])
for i in range(len(c)):outp+=" "+str(c[i])
print(outp)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.reverse()
ans=[]
re_ans=[]
if n==1:
    print(a[0])
else:
    ans=a[::2]
    re_ans=a[1::2]
    re_ans.reverse()
    ans.extend(re_ans)
    map_ans=map(str,ans)
    v=" ".join(map_ans)
    print(v)

Solution (Python):
n = int(input())
a=input().split()
l=n - n %2-1
e=[i for i in a[l::-2]]  
o=[i for i in a[::2]]
e.extend(o)
if n==1:
  print(*a)
elif n % 2 ==0:
  print(*e)
else:
  print(*e[::-1])

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

even = [A[i] for i in range(n) if i % 2 == 0]

odd = [A[i] for i in range(n) if i % 2 != 0]


if n % 2 == 0:
    odd.reverse()
    c = odd+even
else:
    even.reverse()
    c = even+odd
    
print(' '.join([str(i) for i in c]))

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

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

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

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

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

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

for i in range(N):
	print(b[i],end=" ")

print()

Solution (Python):
from collections import deque

toTail = True

n = int(input())
xs = map(int, input().split())

b = deque()
for x in xs:
    if toTail:
        b.append(x)
    else:
        b.appendleft(x)
    toTail = not toTail
if toTail:
    b = list(b)
else:
    b = reversed(list(b))
print(" ".join(map(str, b)))

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
A = []
B = []
s = N // 2
if N % 2 == 0:
    for i in range(N-1, 0, -2):
        A.append(P[i])
    for j in range(0, N-1, 2):
        B.append(P[j])
else:
    for i in range(N-1, -1, -2):
        A.append(P[i])
    for j in range(1, N, 2):
        B.append(P[j])
for i in range(len(A)):
    print(A[i], end=" ")
for j in range(len(B)):
    print(B[j], end=" ")
print()

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

B = list(map(str, B))
print(" ".join(B))

Solution (Python):


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

def cal(p, rev):
    if(rev):
        lst=reversed(list(enumerate(a)))
    else:
        lst=list(enumerate(a))
    for k,v in lst:
        if(k%2==p):
            print(str(v)+" ", end="")

if(n%2==1):
    cal(0, True)
    cal(1, False)
    print()
else:
    cal(1, True)
    cal(0, False)
    print()

Solution (Python):
N = int(input())
lis = list(map(int,input().split()))
lisans = []
i = N-1
while i >= 0:
  lisans.append(lis[i])
  i -= 2
if N % 2 == 0:
  i += 1
else:
  i += 3
while i < N-1:
  lisans.append(lis[i])
  i += 2
print (" ".join(list(map(str,lisans))))

Solution (Python):
n, l = input(), raw_input().split()
print ' '.join(l[0::2][::-1] + l[1::2]) if len(l) % 2 else ' '.join(l[1::2][::-1] + l[0::2])

Solution (Python):
from collections import deque
n, l, b = input(), raw_input().split(), deque()
for t in xrange(n):
    b.append(l[t]) if (t + 1) % 2 else b.appendleft(l[t])
print ' '.join(reversed(b)) if n % 2 else ' '.join(b)

Solution (Python):
from collections import deque
n, l, b = input(), raw_input().split(), deque()
for t in xrange(n):
    if (t + 1) % 2:
        b.append(l[t])
    else:
        b.appendleft(l[t])
print ' '.join(reversed(b)) if n % 2 else ' '.join(b)

Solution (Python):
import sys
from collections import deque

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

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

for _ in b:
    sys.stdout.write(str(_) + " ")
sys.stdout.write("\n")

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

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

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


l=[ i for i in range(n)]
l_gusu=l[0::2]
l_kisu=l[1::2]

ans=[]
for i in reversed(list(l_gusu)):
	
	ans.append(a[i])

for i in l_kisu:
	ans.append(a[i])


ans_str=""
if n%2==0:
	for i in reversed(list(ans)):
		ans_str+=(str(i)+" ")
	print ans_str.strip()
else:
	for i in ans:
		ans_str+=(str(i)+" ")
	print ans_str.strip()

Solution (Python):
import math

num = int(input())
array = [int(x) for x in input().split()]

zero_array = array[0::2]
one_array = array[1::2]

if num % 2 == 0:
    one_array = one_array[:int(num/2)]
    pick = one_array[::-1] + zero_array[:int(num/2)]
else:
    one_array = one_array[:int(num/2)]
    pick= one_array[::-1] + zero_array[:math.ceil(num/2)]

if num % 2 == 0:
    print(" ".join(map(str, pick)))
else:
    print(" ".join(map(str, pick[::-1])))

Solution (Python):
from collections import deque

n = int(input())
a = list(map(int, input().split()))
b = deque()
turn = 1
for ai in a:
    if turn:
        b.append(ai)
    else:
        b.appendleft(ai)
    turn = (turn + 1) & 1

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

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

Solution (Python):
n = int(input())
a = []
b = []

t = True
for i in input().split():
    if t:
        a.append(i)
    else:
        b.append(i)
    t = not t

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

Solution (Python):
from collections import deque


def solve():
    n = int(input())
    a = list(map(str, input().split(" ")))
    ans = deque()

    i = 0
    if n % 2:
        while i != n:
            if i % 2:
                ans.append(a[i])
            else:
                ans.appendleft(a[i])
            i += 1
    else:
        while i != n:
            if i % 2:
                ans.appendleft(a[i])
            else:
                ans.append(a[i])
            i += 1

    print(" ".join(ans))


solve()

Solution (Python):
r = lambda : map(int, raw_input().split())

n = r()[0]
a = r()

i = n-1 ;
while i >= 0 :
    print a[i],
    i -= 2 
    
if n % 2 == 0 : 
    i = 0
else :
    i = 1 
    
while i < n:
    print a[i],
    i += 2

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

for i in range(0,n,2):
    odd.append(a[i])
for i in range(1,n,2):
    even.append(a[i])

if n%2 == 0:
    even.reverse()
    ans = even + odd
else:
    odd.reverse()
    ans = odd + even
print(" ".join(ans))

Solution (Python):

"""
http://abc066.contest.atcoder.jp/tasks/arc077_a

"""
import sys
from sys import stdin
input = stdin.readline



def main(args):
    n = int(input())
    a = [int(x) for x in input().split()]

    
    
    
    
    

    l = len(a)
    b = [0] * l
    pos = l // 2
    if l % 2 == 1:
        direction = 1
    else:
        direction = -1

    step = 1
    for c in a:
        
        b[pos] = c
        pos = pos + (step * direction)
        step += 1
        direction *= -1
        
    print(*b)



if __name__ == '__main__':
    main(sys.argv[1:])

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.append(a[i])
    else:
        b.appendleft(a[i])
if N % 2 == 1:
    [print(b[i], end=' ') for i in reversed(range(len(b)))]
else:
    [print(b[i], end=' ') for i in range(len(b))]

Solution (Python):
import collections

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

for i in range(N):
    if i % 2 == 0:
        b.appendleft(a[i])
    else:
        b.append(a[i])
    
if N % 2 == 0:
    i = N-1
    while i >= 0:
        print(b[i], end = ' ')
        i -= 1
else:
    for i in range(N):
        print(b[i], end = ' ')

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

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

Solution (Python):
from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10
 
 
def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    ans = []
    for i in range(1, len(a_list), 2):
        ans.append(a_list[i])
    ans = ans[::-1]
    for i in range(0, len(a_list), 2):
        ans.append(a_list[i])
 
    if n % 2 != 0:
        ans = ans[::-1]
    print(*ans)
 
 
if __name__ == '__main__':
    main()

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

b = [0]*n

for i in range(n//2):
    b[i] = a[-1-2*i]
    b[n-i-1] = a[-2-2*i]

if n % 2 == 1:
    b[n//2] = a[0]

print(' '.join(b))

Solution (Python):
from collections import deque

N= int(input())

A = list(map(int, input().split()))
A.reverse()
B = deque()
    
if N%2==0:
    for i in range(N):
        if i%2==0:
            B.append(A.pop())
        else:
            B.appendleft(A.pop())
else:
    for i in range(N):
        if i%2!=0:
            B.append(A.pop())
        else:
            B.appendleft(A.pop())

[print("{} ".format(b),end="") for b in B ]

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

    b_list = [-1 for i in range(512345)]
    left = 212345
    right = left+1
    for i in range(n):
        if (i+1)%2 == n%2:
            b_list[left] = a_list[i]
            left -= 1
        else:
            b_list[right] = a_list[i]
            right += 1

    print(' '.join([str(i) for i in b_list[left+1:right]]))

    
if __name__ == "__main__":
    main()

Solution (Python):
def C_pushpush(x):
    from collections import deque
    
    n = int(x[0])
    a = deque(x[1:])
    b = deque([])
    n_parity = n & 1
    for i in range(n):
        if n_parity == (i + 1) & 1:
            
            b.appendleft(a[i])
        else:
            b.append(a[i])
    print(' '.join(b))

n = input()
l = [i for i in input().split()]
x = [n]+l
C_pushpush(x)

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

Solution (Python):


n = int(raw_input())
a = map(int, raw_input().split())
b = [i for i in range(n)]

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

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

Solution (Python):


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

Solution (Python):

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

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

print(" ".join(b))

Solution (Python):



import sys
from collections import deque

n = int(sys.stdin.readline())
ai = list(map(int, sys.stdin.readline().split(' ')))

bi = deque()

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

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

o = ""
while len(bi) > 0:
	o += str(bi.pop()) + " "

o = o[:-1]

print(o)

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

Solution (Python):

from collections import deque

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

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

print(' '.join(map(str, 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+1) %2 == n % 2:
        b.appendleft(a[i])
    else:
        b.append(a[i])
ans = list(b)
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])
    if(i%2 == 1):
        B.appendleft(A[i])

if(n%2 == 1):
    B.reverse()
text = ""
for b in B:
    text += str(b) + " "
text = text[:-1]
print(text)