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: Time Limit Exceeded

Solution code:
#!/usr/bin
# -*- coding="utf-8" -*-
 
n = int(input())
a = input().split()
b = ""
if n == 1:
  b = a[0] + " "
else:
  for i in range(n-1, 0, -2):
    b = b + a[i] + " "
  for i in range(0, n-1, 2):
    b = b + a[i] + " "
    if n % 2 == 1 and i ==0:
      i = i + 1
      b = b + a[i] + " "
print(b[:-1])

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    num = list(map(int,input().split()))
    ans = []
    ans.append(num[0])
    i = 1
    if N%2==0:
        while i < N:
            ans.insert(0,num[i])
            i += 1
            if i < N:
                ans.append(num[i])
                i += 1
    else:
        while i < N:
            ans.append(num[i])
            i += 1
            if i < N:
                ans.insert(0,num[i])
                i += 1
    print(*ans, sep=' ')
main()

Submission status: Time Limit Exceeded

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

result = ""
for i in range(n):
    if i % 2 != n % 2:
        result = " " + str(a_list[i]) + result
    else:
        result = result + " " + str(a_list[i])
print(result.strip())

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8

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

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

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

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8

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

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

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

Submission status: Time Limit Exceeded

Solution code:
from collections import deque

n = int(input())
A = list(map(int, input().split()))
B = deque()
for i in range(n):
    B.append(A[i])
    B.reverse()
 
text = ""
for b in B:
    text += str(b) + " "
text = text[:-1]
print(text)

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

text = ""
for b in B:
    text += str(b) + " "
text = text[:-1]
print(text)

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:
n=input()
ans=[]
s=raw_input().split()
for i in range(n):
    ans.append(int(s[i]))
    ans.reverse()
for i in range(n):
    print ans[i],

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
s = input().split(" ")
b = []
for i in range(num):
    b.append(s[i])
    b.reverse()
    # print(b)
print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
s = input().split(" ")
b = []
ans = ""
for i in range(num):
    b.append(s[i])
    b.reverse()
    # print(b)

for char in b:
    ans += char + " "
print(ans[:-1])

Submission status: Time Limit Exceeded

Solution code:
n = int(raw_input())
a = map(int,raw_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:
    b.reverse()
s = str(b[0])
for i in range(n-1):
    s += ' ' + str(b[i+1])
print s

Submission status: Time Limit Exceeded

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

b = []
stead = []

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

b.reverse()

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

print b.pop()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = input().split()
b=[]
for i in range(N):
    b.append(a[i])
    b = b[::-1] #revese
print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
import re

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

first = ""
second = ""

if (n % 2 == 0):
        for i in range(n):
                if (i % 2 == 0):
                        if (second == ""):
                                second = a[i]
                        else:   
                                second = second + " " + a[i]
                else:   
                        if (first == ""):
                                first = a[i]
                        else:   
                                first = a[i] + " " + first
else:   
        for i in range(n):
                if (i % 2 == 1):
                        if (second == ""):
                                second = a[i]
                        else:   
                                second = second + " " + a[i]
                else:   
                        if (first == ""):
                                first = a[i]
                        else:   
                                first = a[i] + " " + first

print first + " " + second

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import re

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

first = ""
second = ""

if (n % 2 == 0):
        for i in range(n):
                if (i % 2 == 0):
                        if (second == ""):
                                second = a[i]
                        else:   
                                second = second + " " + a[i]
                else:   
                        if (first == ""):
                                first = a[i]
                        else:   
                                first = a[i] + " " + first
else:   
        for i in range(n):
                if (i % 2 == 1):
                        if (second == ""):
                                second = a[i]
                        else:   
                                second = second + " " + a[i]
                else:   
                        if (first == ""):
                                first = a[i]
                        else:   
                                first = a[i] + " " + first

print first + " " + second

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 = b[::-1]
print(' '.join(map(str,b)))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
m = [int(x) for x in input().strip().split()]
nm = []
for i in range(len(m)):
    nm.append(m[i])
    nm.reverse()
for i,x in enumerate(nm):
    if i == len(nm)-1:
        print(str(x), end='')
    else:
        print(str(x) + ' ', end='')

Submission status: Time Limit Exceeded

Solution code:
N = int(raw_input())
A = raw_input().split(" ")


B = []

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


for i in range(len(B)):
	print B[i]

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

b = []

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

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

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

Submission status: Time Limit Exceeded

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

b = []

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

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

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

Submission status: Time Limit Exceeded

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

b = deque()

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

ans = ""
for i in b : 
    ans += str(i) + " "
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys

n = int(input())

a = [int(i) for i in input().split()]
b = []
for j in range(n):
    b.append(a[j])
    b = b[::-1]

for i in range(n):
    sys.stdout.write(str(b[i]))
    sys.stdout.write(" ")

Submission status: Time Limit Exceeded

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

b = []

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

Submission status: Time Limit Exceeded

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

b = []

for a in A:
    b.append(a)
    b = b[::-1]
print(*b)

Submission status: Time Limit Exceeded

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

b=[]
for item in a:
    b.append(item)
    b.reverse()


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

Submission status: Time Limit Exceeded

Solution code:
# !/usr/bin/env python
# -*- coding utf-8 -*-

import sys

n = input()
a = raw_input().split() #a[0], a[1], .., a[n]
n = int(n)
b = []

for i in range(n):
    b.append(a[i])
    if i > 0:
        for j in range((i+1)/2):
            # b = swap(b, j, i-j)
            tmp = b[j]
            b[j] = b[i-j]
            b[i-j] = tmp
for i in range(n):
    print b[i],

Submission status: Time Limit Exceeded

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

for var in range(0,n):
    b.append(nums[var])
    b=b[::-1]

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

Submission status: Time Limit Exceeded

Solution code:
# !/usr/bin/env python
# -*- coding utf-8 -*-

import sys

n = input()
a = raw_input().split() #a[0], a[1], .., a[n]
n = int(n)
b = []

for i in range(n):
    b.append(a[i])
    if i > 0:
        for j in range((i+1)/2):
            # b = swap(b, j, i-j)
            tmp = b[j]
            b[j] = b[i-j]
            b[i-j] = tmp
for i in range(n):
    print b[i],

Submission status: Time Limit Exceeded

Solution code:
# !/usr/bin/env python
# -*- coding utf-8 -*-

import sys

def swap(array_b, index1, index2):
    tmp = array_b[index1]
    array_b[index1] = array_b[index2]
    array_b[index2] = tmp
    return array_b

n = input()
a = raw_input().split() #a[0], a[1], .., a[n]
n = int(n)
b = []

for i in range(n):
    b.append(a[i])
    if i > 0:
        for j in range((i+1)/2):
            b = swap(b, j, i-j)

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

Submission status: Time Limit Exceeded

Solution code:
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())
e=[int(i) for i in input().split()]
b=[]
for i in range(0,n):
    b.append(e.pop(0))
    b.reverse()
p(b)

Submission status: Time Limit Exceeded

Solution code:
from collections import deque

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

b = deque()
for i in range(n):
    b.append(str(l[i]))
    b.reverse()

print(' '.join(b))

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

b = []
for i in range(n):
    b.append(str(l[i]))
    b.reverse()

print(' '.join(b))

Submission status: Time Limit Exceeded

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

for var in range(0,n):
    b.append(nums[var])
    b.reverse()

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
if(__name__ =="__main__"):
    N = int(input())
    a =[int(i) for i in input().split()]
    b = []
    for i in range(N):
        if(i % 2 == (N-1) % 2):
            b.insert(0,a[i])
        else:
            b.append(a[i])
        #print(b)
        # b = b[::-1] TLE:O(N)    
        #print(b)
    #b.extend(a)
    print(' '.join(map(str,b)))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
even = n%2
ans = []
s = list(map(int,(input().split())))
for i in range(n):
    if i%2 != even:
        ans.insert(0,s[i])
    else:
        ans.append(s[i])
print(" ".join(map(str,ans)))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = input().split()
ans = []

for i in range(N) :
    ans.append(a[i])
    ans.reverse()

print(" ".join(ans))

Submission status: Time Limit Exceeded

Solution code:
if __name__ == '__main__':
	n = int(input())
	a = list(map(int, input().split()))

	b = []
	for a_i in a:
		b.append(a_i)
		b = b[::-1]
	
	#print answer
	b = list(map(str, b))
	print (' '.join(b))

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/python

n = int(raw_input())
inp = map(int, raw_input().split())
ans = []

for i, j in enumerate(inp):
    if i % 2 == (n -1) %2:
        ans.insert(0, j)
    else:
        ans.insert(len(ans), j)

for i in ans: print(i),

Submission status: Time Limit Exceeded

Solution code:
quant = int(input())
nums = list(map(int, input().split()))
data = []

for i in range(quant):
    if i % 2 == 0:
        data.append(nums[i])
    else:
        data = [nums[i]] + data

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

Submission status: Time Limit Exceeded

Solution code:
quant = int(input())
nums = list(map(int, input().split()))
data = []

for i in range(quant):
    if i % 2 == 0:
        data.append(nums[i])
    else:
        data.insert(0, nums[i])

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

Submission status: Time Limit Exceeded

Solution code:
# -*- coding:utf-8 -*-
def odd(num):
    return True if num%2!=0 else False
n = int(input())
a = list(input().split())
b = []
for tmp in range(len(a)):
    if odd(n) == odd(tmp+1):
        if len(b) != 0:
            b.insert(0,a[tmp])
        else:
            b.append(a[tmp])
    else:
        b.append(a[tmp])
print(' '.join(b))

Submission status: Time Limit Exceeded

Solution code:
# -*- coding:utf-8 -*-
def odd(num):
    return True if num%2!=0 else False
n = int(input())
a = list(map(int,input().split()))
b = []
for tmp in range(len(a)):
    if odd(n) == odd(tmp+1):
        if len(b) != 0:
            b.insert(0,a[tmp])
        else:
            b.append(a[tmp])
    else:
        b.append(a[tmp])
b = map(str,b)
print(' '.join(b))

Submission status: Time Limit Exceeded

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

print(' '.join(b))

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
import sys
i=0
j=0
k=0
t=0
m=0
s=0
d=0
b=[]
lists=[]
lists2 =[]


n = int(input())
#print (n)
lists=input().split(" ")

#print(lists)

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

d=len(b)
for j in range(d):
	print (b[j], end=" ")

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import sys
n = int(sys.stdin.readline())
a = [x for x in sys.stdin.readline().split()]
b = []
for i in range(n):
    b = b[::-1]
    b.insert(0, a[i])
print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
#! -*- coding:utf-8 -*-
n = int(input())
a = map(int,input().split())
a = list(a)
x = []
#a = []
#for i in range(200000):
#    a.append(i)

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

    count += 1

if n % 2 == 0:
    x.reverse()
    x = map(str,x)
    print(' '.join(x))

else:
    x = map(str,x)
    print(' '.join(x))

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

for bi in b:
    print(str(bi) + " ", end='')

print()

Submission status: Time Limit Exceeded

Solution code:
n = input()

a = map(int, raw_input().split())

ans = []

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

for i in range(len(ans)):
    print ans[i],

Submission status: Time Limit Exceeded

Solution code:
def gyaku(x):
    y = []
    for i in range(len(x)):
        y.append(x.pop())
    return y

n = input()
a = map(int, raw_input().split())
b = []
for i in range(n):
    b.append(a[i])
    b = gyaku(b)
print(' '.join(map(str, b)))

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import sys
n = int(sys.stdin.readline())
a = [int(x) for x in sys.stdin.readline().split()]
b = []
for i in range(n):
    b.append(a[i])
    b = b[::-1]
b_str = list(map(str, b))
print(" ".join(b_str))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = input()

a = map(int, raw_input().split())

ans = []

for i in range(n):
    ans.append(a[i])
    temp = []
    for j in reversed(range(len(ans))):
        temp.append(ans[j])

    ans = temp

for i in range(len(ans)):
    print ans[i],

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
char = input().split()
out = []
for x in range(0,N):
    out.append(char[x])
    out.reverse()
print(" ".join(out))

Submission status: Time Limit Exceeded

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

#print (N, A)

for i in range(len(A)):
    #print (i)
    B.append(A[i])
    B.reverse()
    #print(B)

for i in range(len(B)):
    if i != len(B) - 1:
        print (B[i], end=' ')
    else:
        print(B[i])

Submission status: Time Limit Exceeded

Solution code:
import math
inf=float('inf')
N = int(input())
x = list(map(int, input().split()))
y = []
flg=0
for i in range(N):
    if flg==0:
        y.append(x[i])
        flg=1
        continue
    if flg==1:
        y.insert(0,x[i])
        flg=0
        continue
 
if flg==1:
    y.reverse()
 
for i in range(len(y)):
    print(y[i],end=' ')
 
quit()

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import sys
n = int(sys.stdin.readline())
a = [int(x) for x in sys.stdin.readline().split()]
b = []
for i in range(n):
    b.append(a[i])
    b.reverse()
b_str = list(map(str, b))
print(" ".join(b_str))

Submission status: Time Limit Exceeded

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

#print (N, A)

for i in range(len(A)):
    #print (i)
    B.append(A[i])
    B.reverse()
    #print(B)

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
#Python

N= input()
#print N
a = map(int, raw_input().split())
#print a


b=[]
for i in range(N):
	if i%2==0:
		b.append(a[i])
	elif i%2==1:
		b.insert(0,a[i])
	#print b

#print b

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

for j in range(N):
	print b[j],

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

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


print(*b)

Submission status: Time Limit Exceeded

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


for i in range(1, n+1):
    for j in range(int(i/2)):
        tmp = a[j]
        a[j] = a[i-1-j]
        a[i-1-j] = tmp

for i in a:
    print(i,end=' ')

Submission status: Time Limit Exceeded

Solution code:
#coding=UTF-8

n=int(input())

mozir=input()
hyo=mozir.split(' ')
#a=[int(mono) for mono in hyo]

tmplst=[]
for idx in range(0,n,1):
    if idx%2==0:
        tmplst.append(hyo[idx])
    else:
        tmplst.insert(0,hyo[idx])


#print(tmplst)
demoji=''
if n%2==0:
    for idx in range(0,n,1):
        demoji=demoji + tmplst[idx]
        if idx != n-1:
            demoji=demoji + ' '
else:
    for idx in range(0,n,1):
        demoji=demoji + tmplst[n-(idx+1)]
        if idx != n-1:
            demoji=demoji + ' '

print(demoji)

Submission status: Time Limit Exceeded

Solution code:
#! -*- coding:utf-8 -*-
n = int(input())
a = map(int,input().split())
a = list(a)
x = []

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

    count += 1

if n % 2 == 0:
    x.reverse()
    x = map(str,x)
    print(' '.join(x))

else:
    x = map(str,x)
    print(' '.join(x))

Submission status: Time Limit Exceeded

Solution code:

n = int(input())
abc = input().split(' ')
b = []

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

for i in b:
    print(i, 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 = b[::-1]

print(*b)

Submission status: Time Limit Exceeded

Solution code:
import sys

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

b = []

for i in range(0,N):
	b.append(a[i])
	b.reverse()
	
for i in range(0,N):
	sys.stdout.write(str(b[i]))
	sys.stdout.write(" ")

Submission status: Time Limit Exceeded

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

for i in range(len(a)) :
    if i%2 == 0 :
        b.append(a[i])
    else :
        b.insert(0, a[i])
else :
    if len(a)%2 != 0 :
        b = b[::-1]
    ans = str(b[0])
    for s in b[1:] :
        ans += ' {}'.format(s)
    print(ans)

Submission status: Time Limit Exceeded

Solution code:

n = int(input())
abc = input().split(' ')
b = []

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/python

n = map(int, raw_input())

dt = map(int, raw_input().split())
ans = []

for i in dt:
  ans.append(i)
  ans.reverse()
for ans_ in ans: print(ans_),

Submission status: Time Limit Exceeded

Solution code:
# -*- coding:utf-8 -*-
n = int(input())
a = list(map(int,input().split()))
for tmp in range(1,len(a)):
    a[0:tmp+1] = reversed(a[0:tmp+1])
a = map(str,a)
print(" ".join(a))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:

def main():
    length = int(input())
    reverse = length % 2
    val = input()
    val = val.split()

    res = []
    for (i, v) in enumerate(val):
        if i % 2 == 0:
            res.insert(0, v)
        else:
            res.append(v)
    if reverse:
        print(' '.join(res))
    else:
        print(' '.join(res[::-1]))


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

o=[]
e=[]

if len(a)%2==0:
  mid=N/2
  for i in range(mid):
    e.append(str(a[2*i]))
    o.insert(0, str(a[2*i+1]))
else:
  mid=N/2
  for i in range(mid):
    o.insert(0,str(a[2*i]))
    e.append(str(a[2*i+1]))
  o.insert(0, str(a[-1]))

print ' '.join(o)+' '+' '.join(e)

Submission status: Time Limit Exceeded

Solution code:
#! -*- coding:utf-8 -*-
n = int(input())
a = map(int,input().split())
a = list(a)
x = []

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

    count += 1

if n % 2 == 0:
    x.reverse()
    for i in range(n-1):
        print(x[i],end = ' ')
    print(x[-1])
else:
    for i in range(n-1):
        print(x[i],end = ' ')
    print(x[-1])

Submission status: Time Limit Exceeded

Solution code:
#Python

N= input()
#print N
a = map(int, raw_input().split())
#print a


b=[]
for i in range(N):
	b.append(a[i])
	b.reverse()
	#print b

#print b

for j in range(N):
	print b[j],

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
a = 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()))
b = []

for aa in a :
    b.append(aa)
    b = b[::-1]
else :
    ans = str(b[0])
    for s in b[1:] :
        ans += ' {}'.format(s)
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
b = []
flag = 1
for i in input().split():
    if flag > 0:
        b.append(i)
    else:
        b.insert(0, i)
    flag *= -1
    # print(b)
if flag < 0:
    b.reverse()
for i in b[:-1]:
    print(i+' ', end='')
print(b[-1])

Submission status: Time Limit Exceeded

Solution code:
#coding=UTF-8

n=int(input())

mozir=input()
hyo=mozir.split(' ')
a=[int(mono) for mono in hyo]

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


#print(tmplst)
demoji=''
if n%2==0:
    for idx in range(0,n,1):
        demoji=demoji + str(tmplst[idx])
        if idx != n-1:
            demoji=demoji + ' '
else:
    for idx in range(0,n,1):
        demoji=demoji + str(tmplst[n-(idx+1)])
        if idx != n-1:
            demoji=demoji + ' '

print(demoji)

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()
s = ""
for b_ in b:
    s+=str(b_)
    s+=" "
s=s.rstrip()
print(s)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input().split()
b = []
for i in a:
    b.append(i)
    b.reverse()
n = ""
for i in b:
    n += i + " "
print(n)

Submission status: Time Limit Exceeded

Solution code:
input()
l = []
for i in map(int, input().strip().split()):
    l.append(i)
    l.reverse()
print(" ".join(map(str, l)))

Submission status: Time Limit Exceeded

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

b = []
flag = 1
for i in range(n):
    if flag > 0:
        b.append(a.pop(0))
    else:
        b.insert(0, a.pop(0))
    flag *= -1
if flag < 0:
    b.reverse()
for i in b[:-1]:
    print(i+' ', end='')
print(b[-1])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:

def main():
    length = input()
    val = input()
    val = val.split()

    res = []
    for v in val:
        res.append(v)
        res = res[::-1]
    print(' '.join(res))


if __name__ == '__main__':
    main()