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



Sample input:
4
1 2 3 4


Sample output:
4 2 1 3

Submission status: Wrong Answer

Solution code:

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

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

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

Submission status: Wrong Answer

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

b=a[0::2][::-1]+a[1::2]

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

Submission status: Wrong Answer

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

for i in range(n):
    B.append(A[i])
    B=B[::-1]
print("".join(B))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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:
        k = -2
        rev = False
    k = k - 2 if rev else k + 2

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

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

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

Submission status: Wrong Answer

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

l = []

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

for i in l:
	print i,

Submission status: Wrong Answer

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

l = []

for i in range(a):
	if i % 2 == 1:
		l = [s[i]] + l
	else:
		l = l + [s[i]]

for i in l:
	print i,

Submission status: Wrong Answer

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

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

print b

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
A=list(map(int,input().split()))
ans = []
for i in range(n):
  ans.append(A[i])
  ans = ans[::-1]
print(*ans)

Submission status: Time Limit Exceeded

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

print(*b,sep=' ')

Submission status: Time Limit Exceeded

Solution code:
n = input()
a_list = list(map(int, input().split()))
b_list = []
for i in range(len(a_list)):
    b_list.append(a_list[i])
    b_list.reverse()
answer = " ".join(map(str, b_list))
print(str(answer))

Submission status: Time Limit Exceeded

Solution code:
n = input()
a_list = list(map(int, input().split()))
b_list = []
for i in range(len(a_list)):
    b_list.append(a_list[i])
    b_list.reverse()
answer = " ".join(map(str, b_list))
print(answer)

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

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

print(" ".join(b))

Submission status: Time Limit Exceeded

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

for i in range(1,n):
  b = b + " " + str(a[i])
  b = b[::-1]

print(b)

Submission status: Time Limit Exceeded

Solution code:
# C - pushpush
def main():
    n = int(input())
    a = list(map(int, input().split()))
    ans = []

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

    else:
        print(' '.join(ans))




if __name__ ==  "__main__":
    main()

Submission status: Time Limit Exceeded

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

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


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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    b.append(a[i])
    b = [b[i] for i in reversed(range(len(b)))]

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = list(map(int,input().split()))
L = []

for a in A:
  L.append(a)
  L = L[::-1]

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=list()
for i in a:
    b.append(i)
    b.reverse()
L=[str(a) for a in b]
L=" ".join(L)
print(L)

Submission status: Time Limit Exceeded

Solution code:
from collections import deque


def solve(a):
    ans = deque()

    for i, aa in enumerate(a):
        ans.append(str(aa))
        ans.reverse()

    return list(ans)


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

Submission status: Time Limit Exceeded

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

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

print(*b)

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

for i in range(n):
    b.append(a[i])
    b = list(reversed(b))

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

b = []

for i in a:
    b.append(i)
    b.reverse()

print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=input().split()
LS=""
RS=""
if n%2==0:
    for i in range(n):
        if i==0:
            RS+=a[0]
        elif i==1:
            LS+=a[1]
        elif i%2==0:
            RS=RS+" "+a[i]
        else:
            LS=a[i]+" "+LS
else:
    for i in range(n):
        if i==0:
            LS+=a[0]
        elif i==1:
            RS+=a[1]
        elif i%2==1:
            RS=RS+" "+a[i]
        else:
            LS=a[i]+" "+LS
print(LS,RS)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(input().split())
S=""
if n%2==0:
    for i in range(n):
        if i==0:
            S+=a[0]
        elif i%2==0:
            S=S+" "+a[i]
        else:
            S=a[i]+" "+S
else:
    for i in range(n):
        if i==0:
            S+=a[0]
        elif i%2==1:
            S=S+" "+a[i]
        else:
            S=a[i]+" "+S
print(S)

Submission status: Time Limit Exceeded

Solution code:
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]

import string

def main():
    n = i_input()
    a = i_list()
    b = []
    for i,k in enumerate(a):
        if i%2==0:
            b.append(k)
        else:
            b.insert(0,k)
    if len(a)%2==0:
        print(" ".join(map(str, b)))
    else:
        print(" ".join(map(str, reversed(b))))



if __name__=="__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

a = input().split()

a1 = ""
b = []
for i in range(n):
  a1= a1 + str(i)
  a1 = a1[::-1]
answer = ""
for i in range(n):

  answer =answer + a[int(a1[i])] + ' '

print(answer)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

a = input().split()

a1 = []
b = []
for i in range(n):
  a1 = a[i]
  b.append(a1)
  b.reverse()

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

Submission status: Time Limit Exceeded

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

B = []

rev = False

for i in range(N):
  if rev:
    B = [A[i]] + B
  else:
    B = B + [A[i]]
  rev ^= True
  
if rev:
  B = B[::-1]
    
print(*B)

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
n=int(input())
a=deque(map(int,input().split()))
b=[]
for i in range(n):
    b.append(a.popleft())
    b=b[::-1]
print(*b)

Submission status: Time Limit Exceeded

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

b = []

front = False
for i in a:
    if front:
        b.insert(0, i)
        front = False
    else:
        b.append(i)
        front = True



if front:
    b.reverse()


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

Submission status: Time Limit Exceeded

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

b = []

front = False
for i in a:
    if front:
        b.insert(0, i)
        front = False
    else:
        b.append(i)
        front = True

if front:
    b.reverse()


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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(str,input().split()))
b=[]
for i in range(n):
    b.append(a[i])
    b.reverse()
print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
import queue

N = int(input())
d = list(map(int, input().split()))
b = []
for i in d:
    b.append(i)
    b.reverse()
print(*b)

Submission status: Time Limit Exceeded

Solution code:
'''
Created on 2020/08/28

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  n=int(pin())
  a=list(map(int,pin().split()))
  b=[]
  for i in a:
    b.append(i)
    b.reverse()
  for j in range(n):
    pout(f"{b[j]}")
    if j!=n-1:
      pout(" ")
  return 
main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lsa = list(map(str,input().split()))
lsb = []
if N%2 == 0:
    for i in range(N):    
        if i % 2 == 0:
            lsb.append(lsa[i])
        else:
            lsb = [lsa[i]] + lsb
if N%2 == 1:
    for i in range(N):
        if i % 2 == 1:
            lsb.append(lsa[i])
        else:
            lsb = [lsa[i]] + lsb

print(' '.join(lsb))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lsa = list(map(str,input().split()))
lsb = []
if N%2 == 0:
    for i in range(N):    
        if i % 2 == 0:
            lsb.append(lsa[i])
        else:
            lsb.insert(0,lsa[i]) 
if N%2 == 1:
    for i in range(N):
        if i % 2 == 1:
            lsb.append(lsa[i])
        else:
            lsb.insert(0,lsa[i])

print(' '.join(lsb))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lsa = list(map(str,input().split()))
lsb = []
for i in range(N):
    if N%2 == 0:
        if i % 2 == 0:
            lsb.append(lsa[i])
        else:
            lsb.insert(0,lsa[i]) 
    if N%2 == 1:
        if i % 2 == 1:
            lsb.append(lsa[i])
        else:
            lsb.insert(0,lsa[i])

print(' '.join(lsb))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lsa = list(map(int,input().split()))
lsb = []
for i in range(N):
    if i % 2 == 0:
        lsb.append(lsa[i])
    else:
        lsb.insert(0,lsa[i])
    
if N%2 == 1:
    lsb.reverse() 
lsans = [str(i) for i in lsb]
print(' '.join(lsans))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lsa = list(map(int,input().split()))
lsb = []
for i in range(N):
    lsb.append(lsa[i])
    lsb.reverse()
lsans = [str(i) for i in lsb]
print(' '.join(lsans))

Submission status: Time Limit Exceeded

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

b = []

for i in range(n):
    b.append(a[i])
    b.reverse()

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=list(map(int,input().split()))
d=[]
for i in l:
    d.append(i)
    d.reverse()
print(*d)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
arr = list(map(int, input().split()))
b = []
for i in arr:
    b.append(i)
    b = b[::-1]

print(*b)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy

## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))

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

B = []

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

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

print(B[0],end="")
for i in range(1,N):
    print("",B[i],end="")

Submission status: Time Limit Exceeded

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

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

a = a[1:]

for i in a:
    b.append(str(i))
    b.reverse()


print(' '.join(b))

Submission status: Time Limit Exceeded

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

B = []

for i in range(N):
  B.append(A[i])
  B = B[::-1]
    
print(*B)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a_list = [int(x) for x in input().split()]
b = []
for i, a in enumerate(a_list):
    if i % 2 == 0:
        # b = b + [a]
        b.append(a)
    else:
        # b = [a] + b
        b.insert(0, a)
if n % 2 == 1:
    b = list(reversed(b))
print(*b)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a_list = [int(x) for x in input().split()]
b = []
for i, a in enumerate(a_list):
    if i % 2 == 0:
        b = b + [a]
    else:
        b = [a] + b       
if n % 2 == 1:
    b = list(reversed(b))
print(*b)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a_list = [int(x) for x in input().split()]
b = []
for a in a_list:
    b.append(a)
    b = list(reversed(b))
print(*b)

Submission status: Time Limit Exceeded

Solution code:
n=int(input()) 
c=list(map(int, input().split()))
l = []

if n%2 == 0:
    for i in range(n):
        if i%2 == 0:
            l.append(c[i])
        if i%2 != 0:
            l.insert(0,c[i])
if n%2 != 0:
    for i in range(n):
        if i%2 != 0:
            l.append(c[i])
        if i%2 == 0:
            l.insert(0,c[i])
print(*l)

Submission status: Time Limit Exceeded

Solution code:
import sys 

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


if N == 1:
    print(A[0])
    sys.exit()

mae = []
usiro = []

#0の時に前 1の時に後ろ
Flag = 0

for i in reversed(range(0,N,1)):
    
    if Flag == 0: # 前の時
        mae.append(str(A[i]))
        mae.append(" ")
        Flag = 1
    else:
        usiro.insert(0,str(A[i]))
        usiro.insert(0,str(" "))
        Flag = 0

moziretu = (mae + usiro)
#del moziretu[((len(moziretu))//2)]
moziretu = ''.join(moziretu)
print(moziretu)

Submission status: Time Limit Exceeded

Solution code:
import sys 

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


if N == 1:
    print(A[0])
    sys.exit()

mae = []
usiro = []

#0の時に前 1の時に後ろ
Flag = 0

for i in reversed(range(0,N,1)):
    
    if Flag == 0: # 前の時
        mae.append(str(A[i]))
        mae.append(" ")
        Flag = 1
    else:
        usiro.insert(0,str(A[i]))
        usiro.insert(0,str(" "))
        Flag = 0

moziretu = (mae + usiro)
del moziretu[((len(moziretu))//2)]
moziretu = ''.join(moziretu)
print(moziretu)

Submission status: Time Limit Exceeded

Solution code:
import sys 

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



if N == 1:
    print(A[0])
    sys.exit()

mae = []
usiro = []

#0の時に前 1の時に後ろ
Flag = 0

for i in reversed(range(0,N,1)):
    
    if Flag == 0: # 前の時
        mae.append(str(A[i]))
        Flag = 1
    else:
        usiro.insert(0,str(A[i]))
        Flag = 0

moziretu = (mae + usiro)

string = ""
for i in range(len(moziretu)):
  if (i == 0) or (i == len(moziretu)):
    string = string + moziretu[i]
  else:
    string = string + " " +moziretu[i]
  
print(string)

Submission status: Time Limit Exceeded

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

l = []
for e in a:
    l.append(e)
    l.reverse()

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

Submission status: Time Limit Exceeded

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

ans=[]
for i in range(n):
  if (i+1)%2==1:
    ans=[str(a[i])]+ans
  else:
    ans=ans+[str(a[i])]

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

Submission status: Time Limit Exceeded

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

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

print(*pushpush)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
if n%2 == 0:
    for i in range(n):
        if i%2 == 0:
            b.append(a[i])
        else:
            b.insert(0,a[i])
else:
    for h in range(n):
        if h%2 == 0:
            b.insert(0,a[h])
        else:
            b.append(a[h])
print(*b)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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


lis = []
for i in range(n):
    lis.append(s[i])
    lis = lis[::-1]

print(*lis)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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


lis = []
for i in range(n):
    lis.append(s[i])
    lis = lis[::-1]

print(' '.join(lis))

Submission status: Time Limit Exceeded

Solution code:
import collections
n,rev,q = int(raw_input()) ,False,collections.deque()

stack = []
for ai in map(int, raw_input().split()):
	stack.append(ai)
	stack = stack[::-1]
print ' '.join(map(str, stack))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
for i in a:
    b.append(i)
    b.reverse()
print(*b)

Submission status: Time Limit Exceeded

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

b = []

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

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

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
for i in range(n):
  if i%2==0:
    b.append(a[i])
  else:
    b.insert(0,a[i])
if n%2==0:
  print(' '.join(map(str, b)))
else:
  print(' '.join(map(str, list(reversed(b)))))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().rstrip().split(" ")))
b1 = []
b2 = []
ans = []
if n % 2 == 0:
    for i in range(n):
        if n % 2 == 0:
            b1.append(a[i])
        else:
            b2.append(a[i])
        b1.reverse()
        ans = b1 + b2
    print(" ".join(str(i) for i in ans))
else:
    for i in range(n):
        if n % 2 == 0:
            b1.append(a[i])
        else:
            b2.append(a[i])
        b2.reverse()
        ans = b2 + b1
    print(" ".join(str(i) for i in ans))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().rstrip().split(" ")))
b = []
for i in a:
    b.append(i)
    b.reverse()
s = [str(k) for k in b]
print(" ".join(s))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(n):
    b.append(a[i])
    b.reverse()
print(*b)

Submission status: Time Limit Exceeded

Solution code:
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import product, combinations,permutations
from copy import deepcopy
import sys
sys.setrecursionlimit(4100000)



if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    b = []
    for i in range(n):
        b.append(a[i])
        b.reverse()
    
    print(*b)

Submission status: Time Limit Exceeded

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

for i in range(n):
    b.append(a[i])
    b.reverse()
print(*b)

Submission status: Time Limit Exceeded

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

b = []
ap = b.append

for i in range(n):
  ap(a[i])
  b.reverse()

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(input().split())
B=[A[0]]
for i in range(1,N):
  if i%2!=0:
    B.append(A[i])
  else:
    B.insert(0,A[i])
if N%2==0:
  B=B[::-1]

print(' '.join(B))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a_lst = input().split()
b = []

for i, a in enumerate(a_lst):
  if i % 2 == 0:
    b.append(a)
  else:
    b = [a] + b
if n % 2 == 0:
  print(' '.join(b))
else:
  print(' '.join(list(reversed(b))))

Submission status: Time Limit Exceeded

Solution code:
import sys
from collections import deque
finput=lambda: sys.stdin.readline().strip()

n=int(finput())
a=finput().split()
b=[]

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

Submission status: Time Limit Exceeded

Solution code:
import sys
from collections import deque
finput=lambda: sys.stdin.readline().strip()

n=int(finput())
a=finput().split()
b=[]

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=list(map(int, input().split()))
ans=[l[0]]
for i in range(1, n):
  if i%2==1:
    ans.append(l[i])
  else:
    ans.insert(0, l[i])
if n%2==0:
  ans.reverse()
  print(*ans)
else:
  print(*ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(input().split())
b = []
for i in range(n):
    b.append(a[i])
    b = b[::-1]
print(' '.join(b))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(input().split())
b=[]

for i in range(n):
  b.append(a[i])
  b.reverse()
print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(n):
	ans.append(a[i])
	ans.reverse()
#数字列を空白あり文字列として出力する
print(' '.join(map(str,ans)))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(n):
	ans.append(a[i])
	ans.reverse()
ans_s ='' 
for j in range(n):
	ans_s += str(ans[j])
	ans_s += ' '
print(ans_s)

Submission status: Time Limit Exceeded

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

b = []

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

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

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

Submission status: Time Limit Exceeded

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

b = []

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

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

print(*b)

Submission status: Time Limit Exceeded

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

b = []
r = 1

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

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

print(*b)

Submission status: Time Limit Exceeded

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

b = []
r = 1

b.append(a[0])
for i in range(1, n):
    if(r == 1):
        b.append(a[i])
        r = 0
    elif(r == 0):
        b.insert(0, a[i])
        r = 1
    else:
        pass

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

print(*b)

Submission status: Time Limit Exceeded

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

b = []
r = 1

b.append(a[0])
for i in range(1, n):
    if(r == 1):
        b.append(a[i])
        r = 0
    elif(r == 0):
        b.insert(0, a[i])
        r = 1
    else:
        pass

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

print(*b)

Submission status: Time Limit Exceeded

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

b = []
r = 1
l = 0
for i in range(n):
    if(i == 0):
        b.append(a[i])
        #print(b)
    else:
        if(r == 1):
            b.append(a[i])
            r = 0
            l = 1
            #print("r == 1", b)
        elif(l == 1):
            b.insert(0, a[i])
            r = 1
            l = 0
            #print("l == 1", b)
        else:
            pass

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

print(*b)

Submission status: Time Limit Exceeded

Solution code:
# C - pushpush
n = int(input())
a = list(map(str,input().split()))

b = []

for i in range(n):
    ref = a.pop(0)
    b.append(ref)
    b = list(reversed(b))

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

Submission status: Time Limit Exceeded

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

b = []

for i in a:
    b.append(i)
    b = b[::-1]

print(*b)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = []
for i in range(N):
  if i%2:
    B = [A[i]]+B
  else:
    B = B+[A[i]]
print(*B[::-1] if N%2 else B)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(input().split())
ans=[]
for i in range(n):
    ans.append(a[i])
    ans.reverse()
print(' '.join(ans))

Submission status: Time Limit Exceeded

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

B_=[]
B_.append(A[0]) 

if N > 1:
    B_.append(A[1]+' '+A[0])
    for a_idx in range(2,len(A)):
        B_.append(A[a_idx]+' '+B_[a_idx-2]+' '+A[a_idx-1])
print(B_[-1])

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input().split()
b = ""
for i in range(n):
    if i % 2 != n % 2:
        b = a[i] + " " + b
    else:
        b += a[i] + " "
else:
    print(b[:-1])

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input().split()
b = []
for i in range(n):
    if i % 2 != n % 2:
        b.insert(0, a[i])
    else:
        b += a[i]
else:
    print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
_ = input()
b = []
for i in input().split():
    b.append(i)
    b.reverse()
else:
    print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
_ = input()
b = []
for i in [x for x in input().split()]:
    b.append(i)
    b.reverse()
else:
    print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
_ = input()
a = [x for x in input().split()]
b = []
for i in a:
    b.append(i)
    b.reverse()
else:
    print(" ".join(b))

Submission status: Time Limit Exceeded

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

ans = []
t = 0
for i in a:
  if t == 0: ans.append(i)
  else: ans.insert(0,i)
  t = 1 - t

if t == 0: print(*ans)
else: print(*ans[::-1])

Submission status: Time Limit Exceeded

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

b = []
if n % 2:
    flg = False
else:
    flg = True
for v in a:
    if flg:
        b.append(v)
        flg = False
    else:
        b.insert(0,v)
        flg = True

print(' '.join(b))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = list(map(str, input().split()))
B = list()
cycle = n % 2
for a in A:
    if cycle % 2 == 1:
        B.insert(0, a)
    else:
        B.append(a)
    cycle += 1
print(' '.join(B))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
A=list(map(int,input().split()))
ans=[]
for i in range(n):
  if i%2==0:
    ans.append(A[i])
  else:
    ans=[A[i]]+ans
if n%2!=0:
  ans=ans[::-1]
for i in ans:
  print(i,end=' ')

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
A=list(map(int,input().split()))
ans=[]
for i in range(n):
  if i%2==0:
    ans.append(A[i])
  else:
    ans=[A[i]]+ans
if n%2!=0:
  ans=ans[::-1]
sen=str(ans[0]) 
for i in ans[1:]:
  sen = sen + ' ' + str(i) 
print(sen)