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(raw_input())
a = map(int,raw_input().split(' '))
b = [0 for i in range(int(round(n/2.)))]
b_r = [0 for i in range(n//2)]
for i in range(n):
    if i%2 == 0:
        b[i/2] = a[i]
    else:
        b_r[i/2] = a[i]

n2 = int(round(n/2.))
if n%2 == 0:
    s = str(b_r[n2-1])
    for i in range(1,n):
        if i < n2:
            s += ' ' + str(b_r[n2-1-i])
        else:
            s += ' ' + str(b[i-n2])
    print s
else:
    s = str(b[n2-1])
    for i in range(1,n):
        if i < n2:
            s += ' ' + str(b[n2-1-i])
        else:
            s += ' ' + str(b_r[i-n2])
    print s

Solution (Python):
import sys

n = int(raw_input())
a_list = [int(i) for i in raw_input().split()]




b_list = [0] * n

for i in range(n):
    if n % 2 == 0:
        if i % 2 == 0:
            idx = int(n / 2) + i/2
        else:
            idx = int(n / 2) - i/2 - 1
    else:
        if i % 2 != 0:
            idx = int(n / 2) + i/2 + 1
        else:
            idx = int(n / 2) - i/2
    b_list[idx] = a_list[i]













ans = ''
for b in b_list:
    ans += '{} '.format(b)
ans = ans.rstrip()

print ans

Solution (Python):
N = input()
a = raw_input().split()

even = []
odd = []

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

if N % 2 != 0:
    even.reverse()
else:
    odd.reverse()

ans = []
if N % 2 != 0:
    ans = even + odd
else:
    ans = odd + even

for i in range(N - 1):
    print ans.pop(),

print ans.pop()

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

Solution (Python):


import re

n = int(raw_input())
a = re.split('\s', raw_input())

ans = [0]*n

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

Solution (Python):
n = int(input())
m = [int(x) for x in input().strip().split()]
if n % 2 == 0:
    nm = m[::-2] + m[::2]
else:
    nm = m[::-2] + m[1::2]
for i,x in enumerate(nm):
    if i == n-1:
        print(str(x), end='')
    else:
        print(str(x) + ' ', end='')

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

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

while(n > 0):
    print(l[n-1])
    n -= 2

n+=1
if(n<=0):
    n+=2
    
while(n < len(l)):
    print(l[n-1])
    n += 2

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

for i in range(n):
    if n%2!=0:
        i=n-i-1
    print(str(b[i]) + " ", end="")
print()

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

result = []

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

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

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

b = deque()

for i in range(N) : 
    if i % 2 == 0 : b.append(a[i])
    if i % 2 == 1 : b.appendleft(a[i])

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

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

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

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

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

if n%2 == 1:
    b1.append(a[n-1])
    b1.reverse()
    b.extend(b1)
    b.extend(b2)
else:
    b2.reverse()
    b.extend(b2)
    b.extend(b1)

for item in b:
    print(item, end=" ")

Solution (Python):
from collections import deque
n = int(input())
di = 0
Q = deque()
for i in map(int,input().split()):
    if di: Q.appendleft(i)
    else: Q.append(i)
    di = 1-di
for i in range(n):
    if n%2 == 0: print(Q.popleft(), end=' ')
    else: print(Q.pop(), end=' ')

Solution (Python):
import math
inf=float('inf')
N = int(input())
x = list(map(int, input().split()))
y = [0]*(N)
j=0
for i in range(0,N,1):
    
    if i%2==0:
        y[j]=x[N-1-i]
  
    if i%2==1:
        y[N-1-j]=x[N-1-i]
        j+=1
    
    


for i in range(len(y)):
    print(y[i],end=' ')
 
quit()

Solution (Python):
n=int(input())
nums=input().split()
n1=nums[::2]
n2=nums[1::2]

if len(nums)%2==0:
    ans=" ".join(n2[::-1])+" "+" ".join(n1)
else:
    ans = " ".join(n1[::-1]) + " " + " ".join(n2)

print(ans)

Solution (Python):

n = int(input())
ary = input().split()

if n % 2 == 0:
	out = [i for i in range(2, n+1, 2)]
	out.reverse()
	out.extend([i for i in range(1, n, 2)])
	out_str = [str(ary[i-1]) for i in out]
else:
	out = [i for i in range(1, n + 1, 2)]
	out.reverse()
	out.extend([i for i in range(2, n, 2)])
	out_str = [str(ary[i-1]) for i in out]

print(" ".join(out_str))

Solution (Python):
def p(b):
    for i in range(0,len(b)):
        if i==len(b)-1:
            print(b[i])
        else:
            print(b[i],' ',end="")

n=int(input())
a=[int(i) for i in input().split()]
b=[None]*n
if n%2==1:
    m=int(n/2)
    b[m]=a[0]
    s=1
    t=1
    while s+m<n:
        b[m+s]=a[t]
        t+=1
        b[m-s]=a[t]
        t+=1
        s+=1
    p(b)
else:
    m=int(n/2)
    b[m]=a[0]
    s=1
    t=1
    while s+m<=n:
        b[m-s]=a[t]
        t+=1
        if m-s==0:
            break
        b[m+s]=a[t]
        t+=1
        s+=1
    p(b)

Solution (Python):
from collections import deque

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

b = deque()
for i in range(n):
    if (n % 2 == 0 and (i+1) % 2 == 0) or (n % 2 != 0 and (i+1) % 2 != 0):
        b.appendleft(l[i])
    else:
        b.append(l[i])

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

Solution (Python):
n=int(input())
a=input().split()
for i in range(n):
        if n > 0: 
                print(a[n-1],end=" ")
                n=n-2
                if n == 0 or n == -1:
                        n=n-1
        elif n < 0: 
                print(a[-1*n-1],end=" ")
                n=n-2
print("")

Solution (Python):
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s) % 2:
        print(" ".join(s1[::-1]) +" "+ " ".join(s2))
    else:
        print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))

Solution (Python):
def reverse_append(nums):
    ans = [0] * len(nums)
    left = len(nums) % 2 == 1
    right_i = (len(nums)+1) // 2
    left_i = right_i - 1
    for i in range(len(nums)):
        if left:
            left = not left
            ans[left_i] = nums[i]
            left_i -= 1
        else:
            left = not left
            ans[right_i] = nums[i]
            right_i += 1
    return ans

if __name__ == "__main__":
    raw_input()
    nums = [int(i) for i in raw_input().split()]
    print(" ".join([str(num) for num in reverse_append(nums)]))

Solution (Python):
n=int(input())
data=list(map(str,input().split()))
if(len(data)==1):
    print(data[0])
else:
    newdata = data[::2][::-1]+data[1::2]
    if n%2==0:
        print(' '.join(newdata[::-1]))
    else:
        print(' '.join(newdata))

Solution (Python):
n = int(raw_input())
l = map(int, raw_input().split())
m = []
i = n-1
while i >= 0:
    m.append(l[i])
    i -= 2
i += 1
while i < 0:
    i += 2
while i < n:
    m.append(l[i])
    i += 2
print ' '.join(map(str, m))

Solution (Python):
import sys
n = int(sys.stdin.readline())
a = [x for x in sys.stdin.readline().split()]
b = [a[i] for i in range(n) if i % 2 != 0]
rb = b[::-1]
c = [a[i] for i in range(n) if i % 2 == 0]
rc = c[::-1]

if n % 2 == 0:
    ans = rb + c
else:
    ans = rc + b

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

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

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

Solution (Python):
if(__name__ =="__main__"):
    N = int(input())
    a = [int(i) for i in input().split()]
    b = [0] * 512345
    left = 212345
    right = left + 1
    for i in range(N):
        if(i % 2 == (N-1) % 2):
            
            b[left] = a[i]
            left -= 1
        else:
            
            b[right] = a[i]
            right += 1
        
        
        
    
    
    for i in range(left+1,right):
        print(b[i],end=" ")

Solution (Python):
if(__name__ =="__main__"):
    N = int(input())
    a =[int(i) for i in input().split()]
    b = []
    for i in range(N-1,-1,-2):
        b.append(a.pop(i))
        
        
        
    b.extend(a)
    print(' '.join(map(str,b)))

Solution (Python):
from collections import deque

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

for index, value in enumerate(a):
    if index % 2 == 0:
        b.appendleft(value)
    else:
        b.append(value)
if n % 2 == 0:
    b = reversed(b)
print(" ".join(map(str, b)))

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

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

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

b = [None for i in range(n)]

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






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





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

print()

Solution (Python):
n = int(input())
a = input().split()
b = []
ans = []
even = a[1::2]
odd = a[0::2]
b.append(even)
b.append(odd)

if len(a) % 2 == 0:
    for i in range(1,len(even) + 1):
        ans.append(even[-i])
    ans = ans + odd
else:
    for i in range(1,len(odd) + 1):
        ans.append(odd[-i])
    ans = ans + even
for i in range(len(ans)):
    if i != len(ans) -1:
        print(ans[i],end=" ")
    else:
        print(ans[i])

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

Solution (Python):
from collections import deque

def main():
    N = int(input())
    A = tuple(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(*b, sep=' ')

main()

Solution (Python):
import sys
N=int(input())
a=list(map(int,input().split()))
b=[0 for _ in range(N)]
if(N%2==0):
    l=int(N/2)-1
else:
    l=int(N/2)
r=l+1
for i in range(N):
    if(i%2==(N-1)%2):
        b[l]=a[i]
        l-=1
    else:
        b[r]=a[i]
        r+=1
for index,item in enumerate(b):
    if(index==len(b)-1):
        break
    sys.stdout.write(str(item)+" ")
sys.stdout.write(str(b[N-1])+"\n")

Solution (Python):
from collections import deque

n = int(input())
b = deque()
flag = 1
for i in input().split():
    if flag > 0:
        b.append(i)
    else:
        b.appendleft(i)
    flag *= -1
if flag < 0:
    b.reverse()
print(' '.join(b))

Solution (Python):




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


itr = n
while(itr > 0):
    print(a[itr-1] + ' ', end="")
    itr -= 2
itr = n % 2
while(itr < n):
    print(a[itr] + ' ', end="")
    itr += 2
print()

Solution (Python):
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s) % 2:
        print(" ".join(s1[::-1]) +" "+ " ".join(s2))
    else:
        print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))

Solution (Python):

from collections import deque
def odd(num):
    return True if num%2!=0 else False
n = int(input())
a = list(input().split())
b = deque()
for tmp in range(len(a)):
    if odd(n) == odd(tmp+1):
        b.appendleft(a[tmp])
    else:
        b.append(a[tmp])
print(' '.join(b))

Solution (Python):


from collections import deque

n = int(input())
A = [x for x in 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(" ".join(B))

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

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

print(' '.join(d))

Solution (Python):
import numpy as np
n = int(input())
A = input()
a = list(map(int,A.split(" ")))
a = np.array(a)
even= a[1::2]
odd= a[0::2]
if n%2 == 0:
    b = np.append(even[::-1],odd)
else:
    b = np.append(odd[::-1],even)
 
import sys
for d in b[:-1]:
    sys.stdout.write(str(d)+ " ")
sys.stdout.write(str(b[-1])+"\n")

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

    b = [None] * N
    i = 0
    j = N - 1
    n = 1
    for k in range(N-1, -1, -1):
        if n & 1:
            b[i] = A[k]
            i += 1
        else:
            b[j] = A[k]
            j -= 1
        n += 1

    print(*b, sep=' ')

main()

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

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

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

Solution (Python):
import sys

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

for i in range(0,N):
	if N-1-i*2 >= 0:
		sys.stdout.write(str(a[N-1-i*2]))
		sys.stdout.write(" ")
	elif (N % 2) == 1:
		sys.stdout.write(str(a[int((i-(N-1)/2)*2-1)]))
		sys.stdout.write(" ")
	else:
		sys.stdout.write(str(a[int((i-N/2)*2)]))
		sys.stdout.write(" ")

Solution (Python):
n=int(input())
a=input().split()
b=[a[i] for i in range(n) if i%2!=0] 
rb=b[::-1]
c=[a[i] for i in range(n) if i%2==0] 
rc=c[::-1]

if n%2==0: ans=rb+c
else: ans=rc+b

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

Solution (Python):

b=[]
num=int(input())
a=input().split()


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


print("")

Solution (Python):
n = int(input())
a = input().split(' ')
b = []
inds = [0] * n

for i in range(int(n/2)):
    inds[i] = n-2*i
    inds[n-1-i] = n-2*i-1
if n % 2 == 1:
    inds[int(n/2)] = n-2*int(n/2)

for i, ind in enumerate(inds):
    print(a[ind-1], end="")
    if i != n-1:
        print(' ', end="")
print('')

Solution (Python):
import collections


n = int(input())
sequence = list(map(int, input().split()))
answer = collections.deque()
reverse = False
for i in range(n):
	if reverse is False:
		answer.append(sequence[i])
		reverse = True
	else: 
		answer.appendleft(sequence[i])
		reverse = False
answer = list(answer)
if reverse is True:
	answer.reverse()
print(*answer)

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

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

Solution (Python):


n=int(input())

mozir=input()
hyo=mozir.split(' ')



idx=n-1
ans=''

while idx>=0:
    ans=ans+hyo[idx]
    ans=ans+' '
    idx=idx-2

if idx%2==0:
    idx=1
else:
    idx=0

while idx<n:
    ans=ans+hyo[idx]
    if n-idx <= 2:
        pass
    else:
        ans=ans+' '
    idx=idx+2

print(ans)

Solution (Python):
_ = input()
a = input().split()
n = len(a)
if n % 2 == 0:
    a1 = list(reversed(a[1::2]))
    a2 = a[::2]
else:
    a1 = list(reversed(a[::2]))
    a2 = a[1::2]
print(" ".join(a1 + a2))

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

Solution (Python):
from collections import deque
def main():
    o=deque()
    e=deque()
    n=int(input())
    s=input().split()
    
    for i in range(0,len(s)):
        j=int(s[i])
        if i%2==0:
            o.append(j)
        else:
            e.append(j)
    if n%2==0:
        print(" ".join([str(k) for k in e][::-1])+" "+" ".join([str(m) for m in o]))
    else:
        print(" ".join([str(k) for k in o][::-1])+" "+" ".join([str(m) for m in e]))
if __name__=='__main__':
    main()

Solution (Python):
def main():
    N = int(input().strip())
    b = [None for _ in range(N)]

    index = N // 2
    
    side = -1
    if N % 2 == 0:
        side = 1

    a = map(int, input().strip().split())
    for i, a in enumerate(a):
        index = index + (side * i)
        b[index] = a
        
        side *= -1
    print(" ".join(map(str, b)))

if __name__ == '__main__':
    main()

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

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

count = 0
o = []
e = []

for x in input().split():
	if count%2 == 0:
		o.append(x)
	else:
		e.append(x)
	count += 1

if n%2 == 0:
	tmp = list(reversed(e)) + o
else:
	tmp = list(reversed(o)) + e

ans = ' '.join(x for x in tmp)

print(ans)

Solution (Python):
N = input()
a=(map(str, raw_input().split()))

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

if N%2==0:
    print ' '.join(reversed(odd))+' '+' '.join(even)
else:
    print ' '.join(reversed(even))+' '+' '.join(odd)

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

b = [0]*n

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


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

Solution (Python):
n = int(input())
even = 0
if n % 2 == 0:
    even = 1

el = []
ol = []

s = list(map(int,(input().split())))
for i in range(n):
    if i%2 ==0:
        el.append(s[i])
    else:
        ol.append(s[i])
if even == 1:
    ol.reverse()
    ol.extend(el)
    print(" ".join(map(str,ol)))
else:
    el.reverse()
    el.extend(ol)
    print(" ".join(map(str,el)))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
b1=[]
b2=[]
for i in range(int((n+1)/2)):
    i*=2
    b1.append(a[i])
    i+=1
    if i!=n:
        b2.append(a[i])

s = ""

if n%2==1:
    b3=b2
    b2=b1
    b1=b3
b2.reverse()

for b_ in b2:
    s+=str(b_)
    s+=" "
for b_ in b1:
    s+=str(b_)
    s+=" "
s=s.rstrip()
print(s)

Solution (Python):
n = int(input())
a = input().split(" ")
odds = a[1::2]
evens = a[0::2]
if (n%2)==0:
    odds.reverse()
    ans = odds + evens
    print(' '.join(ans))
else:
    evens.reverse()
    ans = evens + odds
    print(' '.join(ans))

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
b = []
stack = []
a.reverse()
for i in range(n):
    if i%2 == 0:
        b.append(a[i])
    else:
        stack.append(a[i])
for i in range(len(stack)):
    b.append(stack.pop())

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

Solution (Python):

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

flag = [n-2*i if i<n/2 else int((i-n/2)*2+1)  for i in range(n)]
b = [str(a[flag[i]-1]) for i in range(n)]
print(' '.join(b))

Solution (Python):


import numpy as np

if __name__=="__main__":
    n = int(input())
    a = input().split()
    if n%2 == 0:
        index = list(range(2, n+1, 2))
        index.reverse()
        index += list(range(1, n+1, 2))
    else:
        index = list(range(1, n+1, 2))
        index.reverse()
        index += list(range(2, n+1, 2))
    index = np.array(index)
    print(" ".join([a[i-1] for i in index]))

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

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

if n % 2 == 0:
	ans.extend(a_even[::-1])
	ans.extend(a_odd)
else:
	ans.extend(a_odd[::-1])
	ans.extend(a_even)

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

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

b = []
c = []
for i in range(len(a)):
    if (i+1) % 2 !=  0:
        b.append(a[i])
    else:
        c.append(a[i])
if (i + 1) % 2 != 0:
    d = " ".join(reversed(b)) + " " + " ".join(c)
else:
    d = " ".join(reversed(c)) + " " + " ".join(b)

print(d)

Solution (Python):

def get_ln_inputs():
    return input().split()


def get_ln_int_inputs():
    return list(map(int, get_ln_inputs()))


def main():
    n = get_ln_int_inputs()[0]
    a = get_ln_int_inputs()

    ilist = []

    t = n
    while t > 0:
        ilist.append(t)
        t -= 2
    if t == -1:
        t = 2
    else:
        t = 1
    while t < n:
        ilist.append(t)
        t += 2
    
    print(" ".join(str(a[i - 1]) for i in ilist))


main()

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

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

import sys
for i in range(n):
    sys.stdout.write(str(result[i]) + ' ')

Solution (Python):

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

b = []
c = []
for i in range(len(a)):
    if i % 2 == 1:
        b.append(a[i])
    else:
        c.append(a[i])

b.reverse()
b += c

if len(a) % 2 == 1:
    b.reverse()

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

Solution (Python):
from collections import deque
n=int(raw_input())
a=deque(map(int, raw_input().split()))
out=deque([])
if len(a) % 2 == 1:
    out.append(a.popleft())
while len(a) > 0:
    out.append(a.popleft())
    out.appendleft(a.popleft())
print " ".join(map(str, out))

Solution (Python):


n = input()
a = map(int, raw_input().split())
alen = len(a)
b = [0]*alen
if(alen%2 == 0):
    for i,j in enumerate(range(0,alen,2)):
        b[i] = a[alen-1-j]
    for i,j in enumerate(range(0,alen,2)):
        b[alen/2+i] = a[j]
else:
    for i in range(0,alen/2+1):
        b[i] = a[alen-1-2*i]
    for i in range(0,alen/2):
        b[alen/2+1+i] = a[2*i+1]

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

Solution (Python):
n = int(raw_input())
a = map(int, raw_input().split())
if n % 2 == 0:
    bpos = range(n - 1, 0, -2) + range(0, n, 2)
else:
    bpos = range(n - 1, -1, -2) + range(1, n, 2)
for p in bpos:
    print a[p],
print

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

Solution (Python):
n = int(raw_input().rstrip())
a = map(int, raw_input().split())
a_odd = a[0::2]
a_even = a[1::2]
a_even.reverse()
a_even.extend(a_odd)
b = map(str, a_even)
if len(b) % 2 !=0:
    b.reverse()
print ' '.join(b)

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

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

elif n % 2 == 0:
    l1 = [A[n - 2 * i - 1] for i in range(n//2)]
    l2 = [A[2 * j] for j in range(n//2)]

else:
    l1 = [A[n - 2 * i - 1] for i in range(n//2 + 1)]
    l2 = [A[2 * j + 1] for j in range(n//2)]

print(" ".join(l1), " ".join(l2))

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

if len(a)%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(map(int, input().split()))

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

elif n % 2 == 0:
    l1 = [str(A[n - 2 * i - 1]) for i in range(n//2)]
    l2 = [str(A[2 * j]) for j in range(n//2)]

else:
    l1 = [str(A[n - 2 * i - 1]) for i in range(n//2 + 1)]
    l2 = [str(A[2 * j + 1]) for j in range(n//2)]

print(" ".join(l1), " ".join(l2))

Solution (Python):

N = int(input())
inp = [int (x) for x in input().split(" ")]

refs = [0 for _ in range(N)]
k = len(inp) - 1
rev = True
for i in range(N):
    refs[i] = k
    if k == 1 and rev:
        k = -2
        rev = False
    if k == 0 and rev:
        k = -1
        rev = False
    k = k - 2 if rev else k + 2




for i in range(N):
    refs[i] = inp[refs[i]]

print(" ".join([str(x) for x in refs]))

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

l1 = []
l2 = []

if a % 2 == 0:
	for i in range(a):
		if i % 2 == 1:
			l2.append(s[i])
		else:
			l1.append(s[i])
else:
	for i in range(a):
		if i % 2 == 0:
			l2.append(s[i])
		else:
			l1.append(s[i])

for i in reversed(l2):
	print i,

for i in l1:
	print i,

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

else:
	N = int(n // 2)
	for i in range(N + 1):
		print(A[-1 - 2 * i], end = " ")
	for i in range(N - 1):
		print(A[1 + 2 * i], end = " ")
	if n == 1:
		pass
	else:
		print(A[-2])

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

odd = al[1::2]
even = al[0::2]
odd.reverse()
r = odd + even

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

print(" ".join(r))

Solution (Python):
from collections import deque

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

b = deque()

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

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

print(' '.join(b))

Solution (Python):
import math


def f():
    n = int(input())
    a = list(map(int, input().split(" ")))
    b = []
    c = []
    for i in range(len(a)):
        if i % 2 == 0:
            b.append(a[i])
        else:
            c.append(a[i])
    c.reverse()
    d = c+b
    if n % 2 == 1:
        d.reverse()
    d = list(map(str,d))
    print(" ".join(d))


f()

Solution (Python):


from collections import deque


def main():
    n = int(raw_input())
    xs = (int(x) for x in raw_input().split())

    side = 0
    q = deque()

    for x in xs:
        if side == 0:
            q.append(x)
        else:
            q.appendleft(x)

        side = not side

    while q:
        if side == 0:
            print q.popleft(),
        else:
            print q.pop(),


if __name__ == "__main__":
    main()

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

if n % 2 == 0:
	b = a[1::2]
	c = a[0::2]
	b.reverse()
	b.extend(c)
else:
	b = a[0::2]
	c = a[1::2]
	b.reverse()
	b.extend(c)

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

Solution (Python):
n = input()
src = map(int, raw_input().split())
even = []
odd = []
for i in range(n):
    if i%2 == 0:
        even.append(src[i])
    else:
        odd.append(src[i])
even.reverse()
even.extend(odd)
if n%2 == 0:
    even.reverse()
print ' '.join(map(str, even))

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

Solution (Python):



from __future__ import division, print_function
import sys


def main():
    n = int(sys.stdin.readline().strip())
    a = map(int, sys.stdin.readline().strip().split(" "))
    b = [0 for _ in range(n)]
    j = 0
    for i in range(n - 1, -1, -2):
        b[j] = a[i]
        j += 1
    for i in range(0 if n % 2 == 0 else 1, n, 2):
        b[j] = a[i]
        j += 1
    print(" ".join(map(str, b)))


if __name__ == '__main__':
    main()