Young Timofey has a birthday today! He got kit of n cubes as a birthday present from his parents. Every cube has a number a_{i}, which is written on it. Timofey put all the cubes in a row and went to unpack other presents.

In this time, Timofey's elder brother, Dima reordered the cubes using the following rule. Suppose the cubes are numbered from 1 to n in their order. Dima performs several steps, on step i he reverses the segment of cubes from i-th to (n - i + 1)-th. He does this while i ≤ n - i + 1.

After performing the operations Dima went away, being very proud of himself. When Timofey returned to his cubes, he understood that their order was changed. Help Timofey as fast as you can and save the holiday — restore the initial order of the cubes using information of their current location.


-----Input-----

The first line contains single integer n (1 ≤ n ≤ 2·10^5) — the number of cubes.

The second line contains n integers a_1, a_2, ..., a_{n} ( - 10^9 ≤ a_{i} ≤ 10^9), where a_{i} is the number written on the i-th cube after Dima has changed their order.


-----Output-----

Print n integers, separated by spaces — the numbers written on the cubes in their initial order.

It can be shown that the answer is unique.


-----Examples-----
Input
7
4 3 7 6 9 1 2

Output
2 3 9 6 7 1 4
Input
8
6 1 4 2 5 6 9 2

Output
2 1 6 2 5 4 9 6


-----Note-----

Consider the first sample.  At the begining row was [2, 3, 9, 6, 7, 1, 4].  After first operation row was [4, 1, 7, 6, 9, 3, 2].  After second operation row was [4, 3, 9, 6, 7, 1, 2].  After third operation row was [4, 3, 7, 6, 9, 1, 2].  At fourth operation we reverse just middle element, so nothing has changed. The final row is [4, 3, 7, 6, 9, 1, 2]. So the answer for this case is row [2, 3, 9, 6, 7, 1, 4].

Source: codeforces | Difficulty: EASY
Tags: Implementation

Constructive algorithms


Solutions:
import math

def ria():
	return [int(i) for i in input().split()]
n = ria()[0]
ar = ria()
for i in range(0, n // 2, 2):
	(ar[i], ar[n - i - 1]) = (ar[n - i - 1], ar[i])
for i in ar:
	print(i, end=' ')


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


lens = int(input())
arrs = [int(x) for x in input().split()]
i = 0
while i < lens:
	(arrs[i], arrs[lens - 1]) = (arrs[lens - 1], arrs[i])
	i += 2
	lens -= 2
print(*arrs)


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


n = int(input())
a = list(map(int, input().split()))
i = 1
while i <= n - i + 1:
	if i % 2:
		(a[i - 1], a[-i]) = (a[-i], a[i - 1])
	i += 1
print(*a)


n = input()
nums = [int(s) for s in input().split()]
nums2 = []
nums2.extend(nums)
n = len(nums)
if n >= 2:
	for i in range(0, len(nums) // 2, 2):
		(nums[i], nums[n - i - 1]) = (nums[n - i - 1], nums[i])
	for elem in nums:
		print(elem, end=' ')
else:
	print(nums[0])


from sys import stdout
n = int(input())
nums = list(map(int, input().split()))
for i in range(n // 2):
	if i % 2 == 0:
		(nums[i], nums[-i - 1]) = (nums[-i - 1], nums[i])
stdout.write(str(nums[0]))
for k in range(1, n):
	stdout.write(' ' + str(nums[k]))
stdout.write('\n')


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


num = int(input())
l = list(map(int, input().split()))
l = list(reversed(l))
for i in range(num // 2):
	if i % 2 != 0:
		(l[i], l[num - i - 1]) = (l[num - i - 1], l[i])
output = ' '.join(map(str, l))
print(output)


import sys
import math

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def minput():
	return map(int, input().split())

def listinput():
	return list(map(int, input().split()))
n = iinput()
l = listinput()
temp = 0
for i in range(0, int(n / 2)):
	if i % 2 == 0:
		temp = l[i]
		l[i] = l[n - i - 1]
		l[n - i - 1] = temp
print(*l)


n = int(input())
a = list(map(int, input().split()))
for i in range(0, (n - 1) // 2 + 1, 2):
	(a[i], a[n - i - 1]) = (a[n - i - 1], a[i])
print(*a)


n = int(input())
a = input().split()
for i in range(1, n // 2 + 1, 2):
	(a[i - 1], a[-i]) = (a[-i], a[i - 1])
print(*a)


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


import math
n = int(input())
a = list(map(int, input().split(' ')))
m = math.ceil(n / 2)
for i in range(m):
	if i % 2 == 1:
		(a[i], a[n - i - 1]) = (a[n - i - 1], a[i])
a = a[::-1]
print(*a)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7

def LI():
	return list(map(int, input().split()))

def II():
	return int(input())

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

def S():
	return input()

def main():
	n = II()
	a = LI()
	for i in range(0, n, 2):
		j = n - i - 1
		if j <= i:
			break
		(a[i], a[j]) = (a[j], a[i])
	return ' '.join(map(str, a))
print(main())


a = int(input())
a = list(map(int, input().split()))
for i in range(len(a) // 2):
	if i % 2 == 0:
		(a[i], a[-(i + 1)]) = (a[-(i + 1)], a[i])
print(*a)


i = int(input())
li = [int(x) for x in input().split()]
for j in range(len(li) // 2):
	if j % 2 == 0:
		(li[j], li[len(li) - j - 1]) = (li[len(li) - j - 1], li[j])
print(' '.join(map(str, li)))


n = int(input())
array = [int(k) for k in input().split()]
actual = array.copy()
for i in range(len(array) // 2):
	if (i + 1) % 2 == 0:
		continue
	else:
		temp = actual[i]
		actual[i] = actual[n - i - 1]
		actual[n - i - 1] = temp
print(*actual)


input1 = list(map(int, input().split()))
input2 = list(map(int, input().split()))
n = input1[0]
i = 2
if n % 2 == 0:
	t = n / 2
else:
	t = int(n / 2) + 1
for i in range(1, int(t) + 1, 2):
	(input2[i - 1], input2[n - i]) = (input2[n - i], input2[i - 1])
print(' '.join(map(str, input2)))


n = int(input())
a = list(map(int, input().split()))
for i in range(n // 2):
	j = n - i - 1
	if i % 2 == 0:
		t = a[i]
		a[i] = a[j]
		a[j] = t
for i in range(n):
	print(a[i])


n = int(input())
l = list(map(int, input().split()))
i = 0
j = n - 1
while i < j:
	(l[i], l[j]) = (l[j], l[i])
	i = i + 2
	j = j - 2
print(*l)


n = int(input())
arr = [int(x) for x in input().split()]
for i in range(n // 2):
	if i % 2 == 0:
		(arr[i], arr[n - i - 1]) = (arr[n - i - 1], arr[i])
for a in arr:
	print(a, end=' ')
print('')


import sys
n = int(input())
an = list(map(int, sys.stdin.readline().split()))
for i in range(n // 2):
	if i % 2 == 0:
		(an[i], an[n - i - 1]) = (an[n - i - 1], an[i])
print(' '.join(map(str, an)))


n = int(input())
ip = input().split(' ')
ip = list(map(int, ip))
i = 0
while i < n / 2:
	if (i + 1) % 2 != 0:
		temp = ip[i]
		ip[i] = ip[n - 1 - i]
		ip[n - 1 - i] = temp
	i = i + 1
res = ''
for x in range(len(ip)):
	if x == len(ip) - 1:
		res += str(ip[x])
	else:
		res += str(ip[x]) + ' '
print(res)


n = int(input())
a = [int(x) for x in input().split()]
i = 0
while i <= n - (i + 1):
	temp = a[i]
	a[i] = a[n - i - 1]
	a[n - i - 1] = temp
	i += 2
for i in range(n):
	print(a[i], end=' ')


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


def main():
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(n // 2):
		if i % 2 == 0:
			(a[i], a[n - i - 1]) = (a[n - i - 1], a[i])
	print(*a)
main()


(N, l) = (int(input()), [int(x) for x in input().split()])
for i in range(N // 2):
	if i % 2 == 0:
		(l[i], l[N - i - 1]) = (l[N - i - 1], l[i])
print(*l)


(n, l) = (int(input()), list(map(int, input().split())))
for x in range(n // 2):
	if x % 2 == 0:
		(l[x], l[n - x - 1]) = (l[n - x - 1], l[x])
print(*l)


n = int(input())
l = list(map(int, input().split()))
l = l[::-1]
if n <= 2:
	print(*l)
else:
	i = 1
	till = n // 2 - 1
	while i < n // 2:
		(l[i], l[n - i - 1]) = (l[n - i - 1], l[i])
		i = i + 2
	print(*l)


n = int(input())
S = list(map(int, input().split()))
for i in range(n // 2):
	if i % 2 == 0:
		(S[i], S[n - 1 - i]) = (S[n - 1 - i], S[i])
for s in S:
	print(s, end=' ')


n = int(input())
c = [int(x) for x in input().strip().split()]
for k in range(n):
	i = k
	if k > (n - 1) // 2:
		i = n - k + 1
	if i % 2 == 0:
		print(c[n - k - 1], end=' ')
	else:
		print(c[k], end=' ')


n = int(input())
l = []
l = list(map(int, input().split()))
f = -1
for i in range(0, n // 2, 2):
	tmp = l[i]
	l[i] = l[f]
	l[f] = tmp
	f = f - 2
print(' '.join(map(str, l)))


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
n = get_int()
lst = get_int_list()
turn = 0
t = n if n % 2 == 0 else n + 1
for i in range(t // 2):
	if turn == 1:
		turn = 0
	else:
		(lst[i], lst[n - i - 1]) = (lst[n - i - 1], lst[i])
		turn = 1
print(*lst)


n = int(input())
modified_line = [int(x) for x in input().split()]
i = 1
while i <= n - i + 1:
	(modified_line[i - 1], modified_line[-i]) = (modified_line[-i], modified_line[i - 1])
	i += 2
print(*modified_line)


a = int(input())
b = list(map(int, input().split()))
if a % 2:
	c = []
	for i in range(a):
		if i % 2:
			c.append(b[i])
		else:
			c.append(b[a - i - 1])
else:
	c = []
	for i in range(a):
		if i % 2:
			if i < a // 2:
				c.append(b[i])
			else:
				c.append(b[a - i - 1])
		elif i < a // 2:
			c.append(b[a - i - 1])
		else:
			c.append(b[i])
print(' '.join(list(map(str, c))))


from sys import stdin, stdout
import bisect
import math

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
		a *= a
		n = n >> 1
	return r

def solve():
	n = inp()
	l = li()
	i = 0
	j = n - 1
	while i < j:
		(l[i], l[j]) = (l[j], l[i])
		i += 2
		j -= 2
	print(*l)
for _ in range(1):
	solve()


def swap(lst, a, b):
	t = lst[a]
	lst[a] = lst[b]
	lst[b] = t
n = int(input())
arr = [int(i) for i in input().split()]
for i in range(0, int(n / 2)):
	if (i + 1) % 2 != 0:
		swap(arr, i, n - i - 1)
for i in arr:
	print(i, end=' ')
print()


n = int(input())
a = list(map(int, input().split()))
for item in range(n // 2):
	if item % 2 == 0:
		(a[item], a[n - item - 1]) = (a[n - item - 1], a[item])
print(*a)


from sys import stdin
input = stdin.readline
n = int(input())
a = input().split()
for i in range(1, n // 2 + 1, 2):
	(a[i - 1], a[-i]) = (a[-i], a[i - 1])
print(*a)


n = int(input())
a = [int(i) for i in input().split()]
b = len(a) - 1
for i in range(0, len(a), 2):
	if i < len(a) // 2:
		(a[i], a[b - i]) = (a[b - i], a[i])
	else:
		break
print(*a)


n = int(input())
X = list(map(int, input().split()))
i = 0
while i < n / 2:
	if i % 2 == 0:
		(X[i], X[-(i + 1)]) = (X[-(i + 1)], X[i])
	i += 1
print(*X)


read = lambda : map(int, input().split())
n = int(input())
a = [0] + list(read())
ans = [0] + [0] * n
for i in range(1, n // 2 + 1):
	if i % 2:
		ans[n - i + 1] = a[i]
	else:
		ans[i] = a[i]
for i in range(n // 2 + 1, n + 1):
	if i % 2 and n % 2 == 0 or (i % 2 == 0 and n % 2):
		ans[i] = a[i]
	else:
		ans[n - i + 1] = a[i]
print(' '.join(map(str, ans[1:])))


n = int(input())
cubes = input().split()
for i in range(n // 2):
	if i == 0:
		(cubes[0], cubes[-1]) = (cubes[-1], cubes[0])
	if i % 2 == 0 and i >= 2:
		(cubes[i], cubes[n - i - 1]) = (cubes[n - i - 1], cubes[i])
print(' '.join(cubes))


n = int(input())
a = [int(x) for x in input().split()]
flip = True
for i in range(n // 2):
	j = n - i - 1
	if flip:
		(a[i], a[j]) = (a[j], a[i])
	flip = not flip
for ai in a:
	print(ai, end=' ')


n = int(input())
a = list(map(str, input().split()))
x = n // 2
for i in range(0, x, 2):
	(a[i], a[n - 1 - i]) = (a[n - 1 - i], a[i])
print(' '.join(a))


n = int(input())

def t(i):
	if n & 1 or i < n // 2:
		if i & 1:
			return i
		else:
			return n - 1 - i
	elif i & 1:
		return n - 1 - i
	else:
		return i
data = list(map(int, input().split()))
res = [data[t(i)] for i in range(n)]
print(*res)


n = int(input())
l_c = input().split()
h = (n + 1) // 2 - 1
for i in range(n // 2):
	if i % 2 == 0:
		t = l_c[i]
		l_c[i] = l_c[n - i - 1]
		l_c[n - i - 1] = t
print(' '.join(l_c))


n = int(input())
l = list(map(int, input().split()))
limit = len(l) // 2
for i in range(1, limit + 1):
	if i % 2 != 0:
		(l[i - 1], l[n - i + 1 - 1]) = (l[n - i + 1 - 1], l[i - 1])
print(*l)


import sys
n = int(input())
arr = list(map(int, input().split()))
f = 0
l = n - 1
while f < l:
	temp = arr[f]
	arr[f] = arr[l]
	arr[l] = temp
	f += 2
	l -= 2
print(*arr, sep=' ')


n = int(input())
cubes = list(map(int, input().split()))
for i in range(n // 2):
	if not i % 2:
		(cubes[i], cubes[n - i - 1]) = (cubes[n - i - 1], cubes[i])
print(*cubes)


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


n = int(input())
arr = list(map(int, input().split()))
for i in range(n // 2):
	if i % 2 == 0:
		(arr[i], arr[n - i - 1]) = (arr[n - i - 1], arr[i])
print(*arr)


n = int(input())
arr = list(map(int, input().split()))
if n % 2 == 0:
	if n % 4 == 0:
		limit = n // 4
	else:
		limit = n // 4 + 1
else:
	limit = n // 4 + 1
x = 0
for j in range(limit):
	temp = arr[x]
	arr[x] = arr[n - 1 - x]
	arr[n - 1 - x] = temp
	x = x + 2
for i in arr:
	print(i)


n = int(input())
L = [int(x) for x in input().split()]
if n % 2 == 1:
	n += 1
for i in range(1, n // 2 + 1, 2):
	(L[i - 1], L[-1 * i]) = (L[-1 * i], L[i - 1])
for x in L:
	print(x, end=' ')


n = int(input())
arr = input().split()
for i in range(0, n):
	arr[i] = int(arr[i])
for i in range(1, int((n + 1) / 2) + 1):
	if i % 2 == 1:
		(arr[i - 1], arr[n - i]) = (arr[n - i], arr[i - 1])
s = ''
for i in range(0, n):
	s += str(arr[i]) + ' '
print(s)


n = int(input())
l = [0 for i in range(n)]
line = input().split(' ')
i2i = [i for i in range(0, n + 1)]
for i in range(0, n):
	i2i[i + 1] = int(line[i])
st = 1
ed = n
for r in range(n):
	if st > ed:
		break
	if r % 2 == 1:
		l[r] = st
		l[n - 1 - r] = ed
	elif r % 2 == 0:
		l[r] = ed
		l[n - 1 - r] = st
	st = st + 1
	ed = ed - 1
for x in l:
	print(i2i[x], end=' ')


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


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


n = int(input())
a_str = input()
a = a_str.split()
for i in range(n):
	a[i] = int(a[i])
for i in range(n // 2):
	if i % 2 == 0:
		temp = a[i]
		a[i] = a[n - i - 1]
		a[n - i - 1] = temp
for i in a:
	print(i, end=' ')


N = int(input())
nums = list(map(int, input().split()))
for i in range(0, N // 2, 2):
	(nums[i], nums[N - 1 - i]) = (nums[N - 1 - i], nums[i])
print(' '.join(map(str, nums)))


import sys
n = int(input())
arr = [int(x) for x in sys.stdin.readline().split()]
if n & 1 == 0:
	temp = n // 2
else:
	temp = n // 2 + 1
for i in range(temp):
	if i & 1 == 0:
		sw = arr[i]
		arr[i] = arr[-(i + 1)]
		arr[-(i + 1)] = sw
for i in arr:
	print(i, end=' ')


n = int(input())
a = list(map(int, input().split()))
ok = True
if ok:
	for i in range(n // 2):
		if i % 2 == 0:
			(a[i], a[n - i - 1]) = (a[n - i - 1], a[i])
	print(*a)


n = int(input())
a = input().split()
b = ''
(l, r) = (0, n - 1)
while l < r:
	(a[l], a[r]) = (a[r], a[l])
	l += 2
	r -= 2
for i in range(len(a)):
	b += a[i]
	b += ' '
print(b)


def ri():
	return map(int, input().split())
n = int(input())
a = list(ri())
for i in range(n // 2):
	if i % 2 == 0:
		(a[i], a[n - i - 1]) = (a[n - i - 1], a[i])
print(' '.join(map(str, a)))


n = int(input())
v = list(map(int, input().split()))
for i in range(n // 2):
	if i % 2 == 0:
		k = v[i]
		v[i] = v[n - i - 1]
		v[n - i - 1] = k
for i in range(n):
	print(v[i], end=' ')


n = int(input())
L = list(map(int, input().split()))
for i in range(0, n, 2):
	if 2 * i + 1 > n:
		break
	r = L[i]
	L[i] = L[n - 1 - i]
	L[n - 1 - i] = r
for i in range(0, n):
	print('{0} '.format(L[i]), end='')


n = int(input())
l = list(map(int, input().split()))
newl = []
if n % 2 == 0:
	rev = n // 2
else:
	rev = n // 2 + 1
flag = 1
t = n - 1
for i in range(rev):
	flag *= -1
	if flag == -1:
		newl.append(l[t])
		t -= 1
	else:
		newl.append(l[n - t - 1])
		t -= 1
t = 0
flag = -1
help = []
for i in range(rev):
	flag *= -1
	if flag == -1:
		help.append(l[n - t - 1])
	else:
		help.append(l[t])
	t += 1
if n % 2 == 0:
	newl = newl + help[::-1]
else:
	newl = newl[:-1] + help[::-1]
print(*newl)


n = int(input())
lis = input().split()
for i in range(n // 2):
	if i & 1 == 0:
		(lis[-i - 1], lis[i]) = (lis[i], lis[-i - 1])
print(*lis)


import functools, sys
input = lambda : sys.stdin.readline()

def Main():
	n = int(input())
	A = list(map(int, input().split()))
	(B, C) = ([], [])
	ans = []
	for i in range(1, n + 1):
		if i <= n - i + 1:
			B.append(i - 1)
			C.append(n - i + 1 - 1)
			ans.append(i - 1)
			ans.append(n - i + 1 - 1)
		else:
			break
	rez = []
	for i in range(1, len(B) + 1):
		if i % 2 == 1:
			rez.append(C[i - 1])
		else:
			rez.append(B[i - 1])
	for i in reversed(range(1, len(B) + 1)):
		if (i + 1) % 2 == 1:
			rez.append(C[i - 1])
		else:
			rez.append(B[i - 1])
	if n % 2 == 0:
		for i in range(len(rez)):
			print(A[rez[i]], end=' ')
	else:
		for i in range(len(rez)):
			if i == n // 2:
				continue
			else:
				print(A[rez[i]], end=' ')
Main()


number = int(input())
lis = list(map(int, input().split(' ')))
for i in range(0, number // 2, 2):
	(lis[i], lis[number - i - 1]) = (lis[number - i - 1], lis[i])
print(*lis)


n = int(input())
m = [int(x) for x in input().split()]
l = [0] * (n + 1)
for i in range(1, n + 1):
	l[i] = m[i - 1]
k = int(n / 2)
for j in range(1, k + 1):
	if j % 2 != 0:
		t = l[j]
		l[j] = l[n + 1 - j]
		l[n + 1 - j] = t
for i in range(1, n + 1):
	print(l[i], end=' ')


n = int(input())
arr = input().split()
for i in range(0, n // 2, 2):
	(arr[i], arr[n - 1 - i]) = (arr[n - 1 - i], arr[i])
for i in arr:
	print(i)


n = int(input())
a = input().split()
for i in range(0, n // 2, 2):
	(a[i], a[-(i + 1)]) = (a[-(i + 1)], a[i])
print(' '.join([str(j) for j in a]))


Input = lambda : map(int, input().split())
n = int(input())
l = list(Input())
a = 0
b = n - 1
ans = [0] * n
for i in range(n // 2 + n % 2):
	if i % 2 == 0:
		ans[a] = l[b]
		ans[b] = l[a]
	else:
		ans[a] = l[a]
		ans[b] = l[b]
	a += 1
	b -= 1
print(*ans)


n = int(input())
i = 0
a = input().split()
while i <= n // 4:
	if 2 * i + 1 <= n // 2:
		(a[2 * i], a[n - 2 * i - 1]) = (a[n - 2 * i - 1], a[2 * i])
	i += 1
for j in a:
	print(j, end=' ')


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


from sys import stdin, stdout
n = int(stdin.readline())
numbers = stdin.readline().split()
for i in range(n // 2):
	if not i % 2:
		(numbers[i], numbers[-i - 1]) = (numbers[-i - 1], numbers[i])
stdout.write(' '.join(numbers))


def cubes(lst):
	for i in range(len(lst) // 2):
		if i % 2 == 0:
			(lst[i], lst[len(lst) - i - 1]) = (lst[len(lst) - i - 1], lst[i])
	return lst
n = int(input())
a = [int(j) for j in input().split()]
print(*cubes(a))


n = int(input())
daf = list(map(int, input().split()))
has = daf[:]
for i in range(0, n // 2, 2):
	(has[i], has[n - i - 1]) = (daf[n - i - 1], daf[i])
print(*has)


n = int(input().strip())
a = list(map(int, input().strip().split(' ')))
for i in range(n // 2):
	if i & 1 == 0:
		tmp = a[i]
		a[i] = a[n - i - 1]
		a[n - i - 1] = tmp
for elem in a:
	print(elem, end=' ')


n = int(input())
A = [int(x) for x in input().split()]
for i in range(1, int(n / 2) + 1):
	if i & 1:
		u = A[i - 1]
		A[i - 1] = A[n - i]
		A[n - i] = u
for i in A:
	print(i, end=' ')


import sys, queue
try:
	import dev_act_ffc429465ab634
	DEV = True
except:
	DEV = False

def log(*s):
	if DEV:
		print('LOG', *s)

class EJudge:

	def __init__(self, problem='default', reclim=1 << 30):
		self.problem = problem
		sys.setrecursionlimit(reclim)

	def use_files(self, infile='', outfile=''):
		if infile != '':
			self.infile = open(infile)
			sys.stdin = self.infile
		if infile != '':
			self.outfile = open(outfile, 'w')
			sys.stdout = self.outfile

	def use_bacs_files(self):
		self.use_files(self.problem + '.in', self.problem + '.out')

	def get_tl(self):
		while True:
			pass

	def get_ml(self):
		tmp = [[[5] * 100000 for _ in range(1000)]]
		while True:
			tmp.append([[5] * 100000 for _ in range(1000)])

	def get_re(self):
		s = (0,)[8]

	def get_wa(self, wstr='blablalblah'):
		for _ in range(3):
			print(wstr)
		exit()

class IntReader:

	def __init__(self):
		self.ost = queue.Queue()

	def get(self):
		return int(self.sget())

	def sget(self):
		if self.ost.empty():
			for el in input().split():
				self.ost.put(el)
		return self.ost.get()

	def release(self):
		res = []
		while not self.ost.empty():
			res.append(self.ost.get())
		return res

def tokenized(s):
	word = []
	for ch in s.strip():
		if ch == ' ':
			if word:
				yield ''.join(word)
				word = []
		elif 'a' <= ch <= 'z' or 'A' <= ch <= 'Z' or '0' <= ch <= '9':
			word.append(ch)
		else:
			if word:
				yield ''.join(word)
				word = []
			yield ch
	if word:
		yield ''.join(word)
		word = []
ej = EJudge()
int_reader = IntReader()
fmap = lambda f, *l: list(map(f, *l))
parse_int = lambda : fmap(int, input().split())
input()
row = parse_int()
ans = [str(el) for el in row]
(left, right) = (0, len(row) - 1)
reversed = True
while left < right:
	if reversed:
		ans[left] = str(row[right])
		ans[right] = str(row[left])
	else:
		ans[left] = str(row[left])
		ans[right] = str(row[right])
	reversed = not reversed
	left += 1
	right -= 1
print(' '.join(ans))


n = int(input())
line = list(map(str, input().split()))
for i in range(0, n // 2):
	if i % 2 == 0:
		(line[i], line[n - 1 - i]) = (line[n - 1 - i], line[i])
print(' '.join(line))


import sys
debug = True if len(sys.argv) > 1 and sys.argv[1] == '-d' else False
number_of_cubes = int(input())
cubes = [int(x) for x in input().split(' ')]
if debug:
	print('going til {}'.format(number_of_cubes // 2 - 1))
for index in range(number_of_cubes // 2):
	if index % 2 == 0:
		if debug:
			print('switching {index} with {other_index}'.format(index=index, other_index=number_of_cubes - index - 1))
		(cubes[index], cubes[number_of_cubes - index - 1]) = (cubes[number_of_cubes - index - 1], cubes[index])
print(' '.join(map(str, cubes)))


n = int(input())
numbers = [int(x) for x in input().split()]
perm = [0 for i in range(n)]
cnt = n // 2
for i in range(n // 2 - 1, -1, -1):
	perm[i] = cnt
	perm[n - i - 1] = cnt
	cnt -= 1
for i in range(n):
	if perm[i] % 2 == 0:
		print(numbers[i], end=' ')
	else:
		print(numbers[n - i - 1], end=' ')
print()


n = int(input())
arr = input().split()
if n % 2 == 1:
	for i in range(n):
		if i % 2 == 1:
			print(arr[i], end=' ')
		else:
			print(arr[n - 1 - i], end=' ')
else:
	for i in range(n // 2):
		if i % 2 == 1:
			print(arr[i], end=' ')
		else:
			print(arr[n - 1 - i], end=' ')
	for i in range(n // 2, n):
		if i % 2 == 0:
			print(arr[i], end=' ')
		else:
			print(arr[n - 1 - i], end=' ')


n = int(input())
nums = list(map(int, input().split()))
flag = True
for i in range(len(nums)):
	if i == len(nums) / 2:
		flag = not flag
	if flag:
		print(nums[n - i - 1], end=' ')
	else:
		print(nums[i], end=' ')
	flag = not flag


n = int(input())
a = list(map(int, input().split()))
j = n - 1
for i in range(n):
	if i > j:
		break
	if i & 1 == 0:
		(a[i], a[j]) = (a[j], a[i])
	j -= 1
print(' '.join(map(str, a)))


def mmc(n, m):

	def gcd(n, m):
		if m == 0:
			return n
		return gcd(m, n % m)
	return m * n / gcd(m, n)
import sys

def sol(lst):
	n = len(lst) - 1
	for i in range(len(lst) // 2):
		if i % 2 == 0:
			(lst[i], lst[n - i]) = (lst[n - i], lst[i])
	return lst
n = int(input())
lst = [int(i) for i in input().split()]
res = sol(lst)
for el in res:
	print(el, end=' ')


import sys
n = int(input())
arr = list(map(int, input().split()))
mid = int(n / 2)
pos = temp = straight = 0
l = n - 1
for i in range(mid):
	if i < mid:
		if straight == 0:
			temp = arr[i]
			arr[i] = arr[l]
			arr[l] = temp
			straight = 1
		else:
			straight = 0
	elif n % 2 == 0:
		temp = arr[mid - 1]
		arr[mid - 1] = arr[mid]
		arr[mid] = temp
	l -= 1
print(*arr, sep=' ')


n = int(input())
x = list(map(int, input().split()))
for i in range(n):
	if i % 2 == 0 and i < n // 2:
		(x[i], x[n - i - 1]) = (x[n - i - 1], x[i])
	print(x[i], end=' ')


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


a = input()
k = input()
k = k.split(' ')
l = len(k)
i = 0
while i < l // 2:
	(k[i], k[-(i + 1)]) = (k[-(i + 1)], k[i])
	i += 2
print(' '.join(k))


N = int(input())
a = list(map(int, input().split()))
for i in range(N):
	if i > N - i - 1:
		break
	elif i % 2 == 0:
		(a[i], a[N - i - 1]) = (a[N - i - 1], a[i])
print(*a)


n = int(input())
s = list(map(int, input().split()))
r = s[0::2]
if n % 2 == 1:
	for x in range(0, n, 2):
		s[x] = r.pop()
	print(' '.join(map(str, s)))
else:
	t = s[::-1]
	for x in range(0, n // 2, 2):
		(s[x], s[n - x - 1]) = (s[n - x - 1], s[x])
	print(' '.join(map(str, s)))


numOfCubes = int(input())
data = list(map(lambda x: int(x), input().split()))
for i in range(numOfCubes // 2):
	if i % 2 == 0:
		temp = data[i]
		data[i] = data[numOfCubes - i - 1]
		data[numOfCubes - i - 1] = temp
result = ''
for num in data:
	result += str(num) + ' '
print(result[:-1])


import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True
n = ii()
a = li()
for i in range(n // 2):
	if i % 2 == 0:
		(a[i], a[n - i - 1]) = (a[n - i - 1], a[i])
print(wr(a))


n = int(input())
a = [None] + list(map(int, input().split()))
for i in range(1, (n + 2) // 2, 2):
	t = a[i]
	a[i] = a[n - i + 1]
	a[n + 1 - i] = t
print(' '.join(map(str, a[1:])))


n = int(input())
l = list(map(int, input().split()))
i = 0
while i < n // 2:
	t = l[i]
	l[i] = l[n - i - 1]
	l[n - i - 1] = t
	i += 2
for i in l:
	print(i, end=' ')


def main():
	(n, l) = (int(input()), input().split())
	m = n % 4 == 2
	for (i, j) in zip(range(0, n // 2 + 1 + m, 2), range(n - 1, n // 2 - m, -2)):
		(l[i], l[j]) = (l[j], l[i])
	print(' '.join(l))
main()


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	l = LI()
	for i in range((n + 1) // 2):
		if i % 2 == 0:
			tmp = l[n - 1 - i]
			l[n - 1 - i] = l[i]
			l[i] = tmp
	return ' '.join((str(x) for x in l))
print(main())


N = int(input())
A = list(map(int, input().split()))
left = 0
right = N - 1
for i in range(N // 2):
	if i % 2 == 0:
		tmp = A[left]
		A[left] = A[right]
		A[right] = tmp
	left += 1
	right -= 1
print(' '.join(map(str, A)))


import sys
sys.stdin.readline()
cubes = [int(x) for x in map(str.strip, sys.stdin.readline().split(' '))]
i = 0
while i < len(cubes) // 2:
	n = i + 1
	if n % 2:
		tmp = cubes[i]
		cubes[i] = cubes[len(cubes) - i - 1]
		cubes[len(cubes) - i - 1] = tmp
	i += 1
print(' '.join((str(x) for x in cubes)))


count = int(input())
cubs = list(map(int, input().split()))
for i in range(count // 2):
	if i % 2 == 0:
		(cubs[i], cubs[count - i - 1]) = (cubs[count - i - 1], cubs[i])
for i in cubs:
	print(i, end=' ')


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


class div2_395B:

	def solution(self):
		arr = input().split()
		for j in range(0, n // 2, 2):
			(arr[j], arr[n - 1 - j]) = (arr[n - 1 - j], arr[j])
		print(' '.join(arr))
n = int(input())
div2_395B.solution(n)


x = int(input())
lista = list(map(int, input().split()))
for i in range(x // 2):
	if i % 2 == 0:
		(lista[i], lista[x - 1 - i]) = (lista[x - i - 1], lista[i])
print(*lista)


import sys
from math import gcd

def debug(x, table):
	for (name, val) in table.items():
		if x is val:
			print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
			return None

def solve():
	n = int(input())
	As = [int(i) for i in input().split()]
	mid = (n + 1) // 2
	for i in range(mid):
		if i % 2 == 0:
			(As[i], As[n - 1 - i]) = (As[n - 1 - i], As[i])
		else:
			pass
	print(*As)
	pass
solve()


import math
n = int(input())
cubes = input().split()
i = math.ceil(n / 2)
for index in range(i):
	if index % 2 == 0:
		(cubes[index], cubes[n - index - 1]) = (cubes[n - index - 1], cubes[index])
print(' '.join(cubes))


x = int(input())
arr = [int(new) for new in input().split()]
(i, n) = (0, len(arr) - 1)
while i < n - i + 1:
	(arr[i], arr[n - i]) = (arr[n - i], arr[i])
	i += 2
print(*arr)


import sys

def swap(a, b):
	t = a
	a = b
	b = t
	return (int(a), int(b))
n = int(input())
L = list(input().split())
for i in range(0, n // 2):
	if i % 2 == 0:
		(L[i], L[n - 1 - i]) = swap(L[i], L[n - 1 - i])
for x in L:
	sys.stdout.write(str(x))
	sys.stdout.write(' ')


n = int(input())
arr = [int(i) for i in input().split()]
i = 0
j = n - 1
flag = 0
while i < j:
	if flag == 0:
		(arr[i], arr[j]) = (arr[j], arr[i])
		i += 1
		j -= 1
		flag = 1
	else:
		flag = 0
		j -= 1
		i += 1
print(*arr)


n = int(input())
M = input().split()
for i in range(n // 2, 0, -1):
	if i % 2 != 0:
		k = M[-i]
		M[-i] = M[i - 1]
		M[i - 1] = k
print(' '.join(M))


import copy
n = int(input())
arr = list(map(int, input().split(' ')))
narr = copy.copy(arr)
mid = (n + 1) // 2
for i in range(0, mid, 2):
	narr[i] = arr[n - 1 - i]
	narr[n - 1 - i] = arr[i]
print(' '.join(map(str, narr)))


import sys
read = lambda : sys.stdin.readline().strip()
write = lambda x: sys.stdout.write(x + '\n')
n = int(read())
ns = [int(i) for i in read().split()]
cursor = 0
back = n - 1
cnt = (n // 2 + 1) // 2
while cnt:
	(ns[cursor], ns[back]) = (ns[back], ns[cursor])
	cursor += 2
	back -= 2
	cnt -= 1
write(' '.join((str(c) for c in ns)))


n = int(input())
l = input().split()
i = 0
t = 0
while i <= n // 2 - 1:
	t = l[i]
	l[i] = l[-(i + 1)]
	l[-(i + 1)] = t
	i = i + 2
print(' '.join(l))


kub = int(input())
Numb = list(map(int, input().split()))
for i in range(0, kub // 2, 2):
	(Numb[i], Numb[kub - 1 - i]) = (Numb[kub - 1 - i], Numb[i])
print(*Numb)


f = int(input())
seq = input().split()
for i in range(f // 2):
	if i % 2 == 0:
		(seq[i], seq[f - i - 1]) = (seq[f - i - 1], seq[i])
print(' '.join(seq))


x = int(input())
s = list(map(int, input().split()))
for n in range(x // 2):
	if n % 2 == 0:
		t = s[n]
		s[n] = s[x - 1 - n]
		s[x - 1 - n] = t
print(*s)


N = int(input())
A = list(map(int, input().strip().split()))[:N]
B = []
if N % 2 == 1:
	for k in range(0, (N - 1) // 2):
		B.append(A[N - 2 * k - 1])
		B.append(A[2 * k + 1])
	B.append(A[0])
	print(*B)
elif N == 2:
	print(str(A[1]) + ' ' + str(A[0]))
elif N % 2 == 0 and N // 2 % 2 == 0:
	for k in range(0, N // 4 - 1):
		B.append(A[N - 2 * k - 1])
		B.append(A[2 * k + 1])
	B.append(A[N // 2 + 1])
	B.append(A[N // 2 - 1])
	B.append(A[N // 2])
	for i in range(0, N // 4 - 1):
		B.append(A[N // 2 - 2 * i - 2])
		B.append(A[N // 2 + 2 * i + 2])
	B.append(A[0])
	print(*B)
elif N % 2 == 0 and N // 2 % 2 == 1:
	for k in range(0, N // 4):
		B.append(A[N - 2 * k - 1])
		B.append(A[2 * k + 1])
	B.append(A[N // 2])
	B.append(A[N // 2 - 1])
	for i in range(0, N // 4):
		B.append(A[N // 2 + 2 * i + 1])
		B.append(A[N // 2 - 2 * i - 3])
	print(*B)


def swap(i, j):
	global a
	temp = a[i]
	a[i] = a[j]
	a[j] = temp
n = int(input())
a = list(map(int, input().split()))
for i in range(int(n // 2)):
	if i % 2 == 0:
		swap(i, n - i - 1)
print(*a)


from sys import stdin

def iinput():
	return int(stdin.readline())

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
n = iinput()
a = linput()
(i, j) = (0, n - 1)
while i < j:
	(a[i], a[j]) = (a[j], a[i])
	i += 2
	j -= 2
print(*a)


def codeforces(nums):
	lst_a = nums[:len(nums) // 2]
	lst_b = nums[len(nums) - len(lst_a):]
	if len(nums) % 2 != 0:
		middle = [nums[len(nums) // 2]]
	else:
		middle = []
	lst_b.reverse()
	for i in range(len(lst_a)):
		if i % 2 != 0:
			continue
		(lst_a[i], lst_b[i]) = (lst_b[i], lst_a[i])
	lst_b.reverse()
	return map(str, lst_a + middle + lst_b)
_ = input()
nums = list(map(int, input().split()))
print(' '.join(codeforces(nums)))


n = int(input())
a = input().split()
times = (n + 1) // 2
a = a[::-1]
for x in range(1, times):
	if x % 2 != 0:
		hold = a[x]
		y = -1 * x - 1
		a[x] = a[y]
		a[y] = hold
	else:
		pass
print(' '.join(a))


n = int(input())
a = list(map(int, input().split(' ')))
for i in range(n // 2):
	if not i & 1:
		(a[i], a[-i - 1]) = (a[-i - 1], a[i])
print(' '.join(map(str, a)))


def swap(lst, n, i):
	temp = lst[i]
	lst[i] = lst[n - i - 1]
	lst[n - i - 1] = temp
	return lst
n = int(input())
arr = list(map(int, input().split()))
i = 0
for i in range(n // 2):
	if i % 2 == 0:
		arr = swap(arr, n, i)
print(*arr)


n = int(input())
l = list(map(int, input().split()))
for i in range(n // 2):
	if (i + 1) % 2 == 1:
		(l[i], l[n - 1 - i]) = (l[n - 1 - i], l[i])
print(*l)


def r():
	return list(map(int, input().split()))
n = int(input())
a = r()
for i in range((n + 1) // 2):
	if i & 1:
		continue
	tmp = a[i]
	a[i] = a[n - i - 1]
	a[n - i - 1] = tmp
print(' '.join((str(i) for i in a)))


def solve(list, length):
	res = [None] * length
	for (order, val) in enumerate(list):
		if order > length - order - 1:
			break
		if order % 2 == 1:
			res[order] = val
			res[length - order - 1] = list[length - order - 1]
		else:
			res[length - order - 1] = val
			res[order] = list[length - order - 1]
	return [str(i) for i in res]

def main():
	a = int(input())
	b = [int(a) for a in input().split(' ')]
	print(' '.join(solve(b, a)))
main()


total = 0
nums = []

def inp():
	global total, nums
	total = int(input())
	i = input()
	nums = i.split(' ')
	nums = [int(num) for num in nums]

def solve():
	global total, nums
	mid = int(total / 2)
	rs = nums[:]
	for i in range(1, mid + 1):
		if i % 2 != 0:
			rs[i - 1] = nums[total - i]
			rs[total - i] = nums[i - 1]
			continue
		rs[i - 1] = nums[i - 1]
		rs[total - i] = nums[total - i]
	return rs

def printrs(rs):
	for i in range(len(rs)):
		if i == len(rs) - 1:
			print(rs[i])
			return
		print(rs[i], end=' ')
inp()
rs = solve()
printrs(rs)


from collections import deque
n = int(input())
a = [int(i) for i in input().split()]
chk = deque()
if n % 4 == 0:
	for i in range(n // 2):
		if i == 0:
			chk.append(n // 2 - 1)
			chk.append(n // 2)
		elif i % 2 == 1:
			chk.appendleft(chk[-1] + 1)
			chk.append(chk[1] - 1)
		else:
			chk.appendleft(chk[-1] - 1)
			chk.append(chk[1] + 1)
elif n % 4 == 2:
	for i in range(n // 2):
		if i == 0:
			chk.append(n // 2)
			chk.append(n // 2 - 1)
		elif i % 2 == 1:
			chk.appendleft(chk[-1] - 1)
			chk.append(chk[1] + 1)
		else:
			chk.appendleft(chk[-1] + 1)
			chk.append(chk[1] - 1)
elif n % 4 == 3:
	chk.append(n // 2)
	for i in range(n // 2):
		if i % 2 == 1:
			chk.append(chk[0] + 1)
			chk.appendleft(chk[-2] - 1)
		else:
			chk.append(chk[0] - 1)
			chk.appendleft(chk[-2] + 1)
else:
	chk.append(n // 2)
	for i in range(n // 2):
		if i % 2 == 1:
			chk.append(chk[0] - 1)
			chk.appendleft(chk[-2] + 1)
		else:
			chk.append(chk[0] + 1)
			chk.appendleft(chk[-2] - 1)
ans = [a[i] for i in chk]
print(*ans)


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


n = int(input())
a = input().split()
half_len = n // 2
for i in range(half_len):
	if i * 2 < half_len:
		(a[i * 2], a[~i * 2 + 1]) = (a[~i * 2 + 1], a[i * 2])
print(' '.join(a))


n = int(input())
a = list(input().split())
if not n % 2:
	a.insert(n // 2, 'a')
	n += 1
for i in range(n):
	if i % 2 and a[i] != 'a':
		print(a[i], end=' ')
	elif a[i] != 'a':
		print(a[n - 1 - i], end=' ')


def main():
	n = int(input())
	arr = list(map(int, input().split()))
	for i in range(0, n // 2, 2):
		temp = arr[i]
		arr[i] = arr[n - i - 1]
		arr[n - i - 1] = temp
	for i in range(n):
		print(arr[i], end=' ')
main()


n = int(input())
a = [int(i) for i in input().split()]
for i in range(n // 2):
	if i % 2 == 0:
		tmp = a[i]
		a[i] = a[n - 1 - i]
		a[n - 1 - i] = tmp
for i in a:
	print(i, end=' ')


from math import ceil as c
(n, l) = (int(input()), list(map(int, input().split())))
for x in range(c(n / 2)):
	if x % 2 == 0:
		(l[x], l[n - x - 1]) = (l[n - x - 1], l[x])
print(*l)


def main():
	n = int(input())
	a = input().split()
	for i in range(0, n // 2, 2):
		(a[i], a[-i - 1]) = (a[-i - 1], a[i])
	print(' '.join(a))
main()


from math import ceil
n = int(input())
a = list(map(int, input().split()))
for i in range(0, ceil(n / 2)):
	if i % 2 == 0:
		(a[i], a[n - i - 1]) = (a[n - i - 1], a[i])
print(' '.join(map(str, a)))


n = int(input())
a = list(map(str, input().split(' ')))
i = 0
while i < int(n / 2):
	(a[i], a[n - i - 1]) = (a[n - i - 1], a[i])
	i += 2
print(' '.join(a))


n = int(input())
li = list(map(int, input().split()))
for i in range((n + 1) // 2):
	if i % 2 == 0:
		temp = li[n - i - 1]
		li[n - i - 1] = li[i]
		li[i] = temp
print(' '.join((str(x) for x in li)))


n = int(input())
l = [int(x) for x in input().split()]
c = 0
k = 0
while c < len(l) // 2:
	k = l[c]
	l[c] = l[n - c - 1]
	l[n - c - 1] = k
	c = c + 2
for i in l:
	print(i, end=' ')


n = int(input())
data = list(map(int, input().split()))
for i in range(0, n // 2, 2):
	(data[i], data[n - i - 1]) = (data[n - i - 1], data[i])
print(' '.join(map(str, data)))


R = lambda : map(int, input().split())
(n,) = R()
arr = list(R())
for i in range(1, n // 2 + 1, 2):
	(arr[i - 1], arr[-i]) = (arr[-i], arr[i - 1])
print(*arr)


n = int(input())
s = input().split()
m = 0
if n % 2 == 0 and n % 2 != 4:
	m = int(n // 2)
elif n % 2 == 0:
	m = int(n // 2) - 1
else:
	m = int(n // 2)
if n == 2:
	s.reverse()
	print(' '.join(s))
else:
	for i in range(m):
		if i % 2 == 0:
			(s[i], s[n - i - 1]) = (s[n - i - 1], s[i])
	print(' '.join(s))


n = int(input())
a = [int(x) for x in input().split()]
for i in range(len(a) // 2):
	if i % 2 == 0:
		temp = a[i]
		a[i] = a[len(a) - 1 - i]
		a[len(a) - 1 - i] = temp
answer = ''
for x in a:
	answer += str(x) + ' '
print(answer)


n = int(input())
l = list(map(int, input().split()))
k = int(round(n / 2))
for i in range(k):
	if (i + 1) % 2 == 1:
		(l[i], l[n - 1 - i]) = (l[n - 1 - i], l[i])
s = ''
for i in range(n):
	if i == n - 1:
		s += str(l[i])
	else:
		s += str(l[i]) + ' '
print(s)


n = int(input())
arr = list(map(int, input().split()))
for i in range(n // 2):
	if not i % 2:
		tmp = arr[i]
		arr[i] = arr[n - i - 1]
		arr[n - i - 1] = tmp
print(*arr)


n = int(input())
ar = list(input().split())
for i in range(0, n // 2, 2):
	(ar[i], ar[-1 - i]) = (ar[-1 - i], ar[i])
print(' '.join(ar))


n = int(input())
p = list(map(int, input().split(' ')))
for i in range(n // 2):
	if i == 0 or i % 2 == 0:
		temp = p[i]
		p[i] = p[n - i - 1]
		p[n - i - 1] = temp
p = list(map(str, p))
print(' '.join(p))


class CodeforcesTask764BSolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.a = []

	def read_input(self):
		self.n = int(input())
		self.a = [int(x) for x in input().split(' ')]

	def process_task(self):
		if self.n % 2:
			array = [self.a[x] if x % 2 else self.a[self.n - x - 1] for x in range(self.n)]
		else:
			array = []
			for x in range(self.n // 2):
				if x % 2:
					array.append(self.a[x])
				else:
					array.append(self.a[self.n - 1 - x])
			for x in range(self.n // 2):
				if not x % 2:
					array.append(self.a[self.n // 2 + x])
				else:
					array.append(self.a[self.n // 2 - 1 - x])
		if self.n < 10000:
			array = self.a
			i = 1
			while i <= self.n - i + 1:
				first = array[:i - 1]
				second = array[i - 1:self.n - i + 1][::-1]
				third = array[self.n - i + 1:]
				array = first + second + third
				i += 1
		if self.n == 2:
			array = self.a[::-1]
		self.result = ' '.join([str(x) for x in array])

	def get_result(self):
		return self.result
Solution = CodeforcesTask764BSolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


i = 0
j = int(input())
j = j - 1
a = list(map(int, input().split()))
while j > i:
	(a[j], a[i]) = (a[i], a[j])
	i = i + 2
	j = j - 2
for i in a:
	print(i, end=' ')


n = int(input())
lst = [int(x) for x in input().split()]
l = len(lst)
for i in range(0, int(l / 2), 2):
	(lst[i], lst[l - 1 - i]) = (lst[l - i - 1], lst[i])
for i in range(l):
	print(lst[i], end=' ')


n = int(input())
l = list(map(int, input().split()))
i = 0
while i < len(l) // 2:
	t = l[i]
	l[i] = l[n - i - 1]
	l[n - i - 1] = t
	i = i + 2
print(*l)


n = int(input())
ai = list(map(int, input().split()))
ans = [str(ai[(n - i - 1) * ((i + 1 + (n % 2 == 0 and i >= n // 2)) % 2) + i * ((i + (n % 2 == 0 and i >= n // 2)) % 2)]) for i in range(n)]
print(' '.join(ans))


def main():
	n = int(input())
	numbers = [int(_) for _ in input().split()]
	for i in range(0, n // 2, 2):
		j = n - 1 - i
		temp = numbers[i]
		numbers[i] = numbers[j]
		numbers[j] = temp
	print(' '.join(list((str(number) for number in numbers))))
main()


def swaping(z, w, e):
	temp = z[e]
	z[e] = z[w]
	z[w] = temp
	return z
q = int(input())
qwerty = input()
p = [int(i) for i in qwerty.split(' ')]
i = 0
while i < q - i:
	p = swaping(p, i, q - i - 1)
	i += 2
for i in p:
	print('{} '.format(i))


n = int(input())
lis = list(map(int, input().split()))
ans = [0] * n
if n % 2 != 0:
	j = n - 1
	for i in range(n):
		if i % 2 == 0:
			ans[j] = lis[i]
			j -= 2
		else:
			ans[i] = lis[i]
	print(*ans)
else:
	j = n - 1
	i = 0
	while i < n // 2:
		if i % 2 == 0:
			ans[j] = lis[i]
			ans[i] = lis[j]
		else:
			ans[i] = lis[i]
			ans[j] = lis[j]
		i += 1
		j -= 1
	print(*ans)


n = int(input())
kubes = list(map(int, input().split()))
for i in range(n):
	if i < (n + 1) // 2 and i % 2 == 0:
		print(kubes[n - i - 1], end=' ')
	elif i >= (n + 1) // 2 and (n - i) % 2 == 1:
		print(kubes[n - i - 1], end=' ')
	else:
		print(kubes[i], end=' ')


n = int(input())
cubes = [int(x) for x in input().split()]
cubes.insert(0, 0)
i = 1
while i <= n - i + 1:
	if i % 2 == 1:
		tmp = cubes[i]
		cubes[i] = cubes[n + 1 - i]
		cubes[n + 1 - i] = tmp
	i += 1
cubes.pop(0)
for cube in cubes:
	print(cube, end=' ')


N = int(input()) - 1
_arr = list(map(int, input().split()))
i = 0
while i < N - i:
	if (i + 1) % 2 != 0:
		_t = _arr[i]
		_arr[i] = _arr[N - i]
		_arr[N - i] = _t
	i += 1
_arr = list(map(str, _arr))
print(' '.join(_arr))


n = int(input())
s = list(map(int, input().split()))
for i in range(n // 2):
	if i <= n - i + 1 - 2 and i % 2 == 0:
		b = n - i + 1 - 2
		a = s[i]
		s[i] = s[b]
		s[b] = a
print(*s)


N = int(input())
l = list(map(int, input().split()))
i = 0
LEN = len(l)
while i < LEN - i - 1:
	if i % 2 == 0:
		(l[i], l[LEN - i - 1]) = (l[LEN - i - 1], l[i])
	i += 1
print(' '.join(map(str, l)))


def main():
	n = int(input())
	s = ''
	arr = [int(a) for a in input().split()]
	if n % 2 != 0:
		for i in range(0, int((n - 1) / 2), 2):
			temp = arr[i]
			arr[i] = arr[n - i - 1]
			arr[n - i - 1] = temp
		print(' '.join(map(str, arr)))
	else:
		for i in range(0, int(n / 2), 2):
			temp = arr[i]
			arr[i] = arr[n - i - 1]
			arr[n - i - 1] = temp
		print(' '.join(map(str, arr)))
main()


n = int(input())
A = list(map(int, input().split()))
st = True
for i in range(0, n // 2):
	if st:
		(A[i], A[-(i + 1)]) = (A[-(i + 1)], A[i])
		st = False
	else:
		st = True
for i in range(len(A)):
	print(A[i], end=' ')


n = int(input())
ar = input().split()
for i in range(1, n // 2 + 1, 2):
	(ar[i - 1], ar[-i]) = (ar[-i], ar[i - 1])
print(*ar)


from sys import stdin as fin
n = int(fin.readline())
arr = tuple(map(int, fin.readline().split()))
i = None
if n % 2:
	for j in range(n):
		i = j
		print(arr[i] if i % 2 else arr[n - i - 1], end=' ')
else:
	for j in range(n // 2):
		i = j
		print(arr[i] if i % 2 else arr[n - i - 1], end=' ')
	for j in range(i, -1, -1):
		i = j
		print(arr[i] if not i % 2 else arr[n - i - 1], end=' ')


n = int(input())
arr = list(map(int, input().split()))
i = 0
while i < n - 1 - i:
	(arr[i], arr[n - 1 - i]) = (arr[n - 1 - i], arr[i])
	i += 2
print(*arr)


n = int(input().strip())
arr = list(map(int, input().strip().split()))
i = 0
j = n - 1
while i < j:
	if i % 2 == 0:
		(arr[i], arr[j]) = (arr[j], arr[i])
	i += 1
	j -= 1
print(*arr)


n = int(input())
arr = list(map(int, input().split()))
(l, r) = (0, n - 1)
while l < r:
	(arr[l], arr[r]) = (arr[r], arr[l])
	l += 2
	r -= 2
print(*arr)


import math as mt
import sys, string
from collections import Counter, defaultdict
I = lambda : int(input())
M = lambda : map(int, input().split())
ARR = lambda : list(map(int, input().split()))

def printARR(arr):
	for e in arr:
		print(e, end=' ')
	print()

def main():
	n = I()
	arr = ARR()
	for i in range(n // 2):
		if i % 2 == 0:
			(arr[i], arr[n - i - 1]) = (arr[n - i - 1], arr[i])
	printARR(arr)
tc = 1
for _ in range(tc):
	main()


n = int(input())
cubes = input().split()
if n >= 4:
	for i in range(n // 4 + (1 if n % 2 else 0)):
		(cubes[2 * i], cubes[-2 * i - 1]) = (cubes[-2 * i - 1], cubes[2 * i])
	if n % 4 == 2:
		(cubes[n // 2], cubes[n // 2 - 1]) = (cubes[n // 2 - 1], cubes[n // 2])
else:
	(cubes[0], cubes[-1]) = (cubes[-1], cubes[0])
print(' '.join(cubes))


i = int(input())
r = [0] * i
l = list(map(int, input().split()))
start = []
end = []
for x in range(i // 2):
	if x % 2:
		start.append(l[x])
		end.append(l[-(x + 1)])
	else:
		start.append(l[-(x + 1)])
		end.append(l[x])
if i % 2:
	total = start + [l[i // 2]] + end[::-1]
	print(' '.join((str(x) for x in total)))
else:
	total = start + end[::-1]
	print(' '.join((str(x) for x in total)))


import sys
fin = sys.stdin
fout = sys.stdout
n = int(fin.readline())
a = list(map(int, fin.readline().split()))
if n == 2:
	a.reverse()
	fout.write(' '.join(map(str, a)))
	sys.exit()
if n % 2 == 1:
	mid = n // 2
	l = 0
	r = n - 1
	it = 0
	while l < r:
		if it % 2 == 0:
			(a[l], a[r]) = (a[r], a[l])
		l += 1
		r -= 1
		it += 1
else:
	l = 0
	r = n - 1
	it = 0
	while l < r:
		if it % 2 == 0:
			(a[l], a[r]) = (a[r], a[l])
		l += 1
		r -= 1
		it += 1
fout.write(' '.join(map(str, a)))


import math

def main_function():
	input()
	a = [int(i) for i in input().split(' ')]
	for i in range(len(a) // 2):
		if not i % 2:
			(a[i], a[len(a) - 1 - i]) = (a[len(a) - 1 - i], a[i])
	return ' '.join([str(i) for i in a])
print(main_function())


n = int(input())
numbers = [x for x in range(n)]
for x in range(0, n // 2, 2):
	(numbers[x], numbers[n - x - 1]) = (numbers[n - x - 1], numbers[x])
string = input()
cubes = string.split()
print(' '.join([cubes[x] for x in numbers]))


import sys
import math

class Solver(object):

	def run(self):
		n = int(input())
		a = [int(i) for i in input().split(' ')]
		for i in range(0, int(n / 2), 2):
			tmp = a[i]
			a[i] = a[n - i - 1]
			a[n - i - 1] = tmp
		print(' '.join((str(i) for i in a)))

def gcd(a, b):
	return math.gcd(a, b)

def lcm(a, b):
	return abs(a, b) / gcd(a, b) if a and b else 0
Solver().run()


a = input()
k = input()
k = k.split(' ')
l = len(k)
if a[-1] == '2' or a[-1] == '4' or a[-1] == '6' or (a[-1] == '8') or (a[-1] == '0'):
	i = 0
	while i < l // 2:
		(k[i], k[-(i + 1)]) = (k[-(i + 1)], k[i])
		i += 2
else:
	i = 0
	while i < l // 2:
		(k[i], k[-(i + 1)]) = (k[-(i + 1)], k[i])
		i += 2
print(' '.join(k))


def read_input():
	m = int(input())
	list = []
	for _ in range(m):
		list.append(0)
	line = input().strip().split()
	if m % 2 != 0:
		for i in range(m):
			if i % 2 == 0:
				list[m - i - 1] = int(line[i])
			else:
				list[i] = int(line[i])
	else:
		for i in range(m // 2):
			if i % 2 == 0:
				list[m - i - 1] = int(line[i])
				list[i] = int(line[m - i - 1])
			else:
				list[i] = int(line[i])
				list[m - i - 1] = int(line[m - i - 1])
	for i in range(m):
		print(list[i], end=' ')
read_input()


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


n = int(input())
a = list(map(int, input().split()))
l = 0
r = n - 1
while l <= r:
	if l % 2 == 0:
		(a[l], a[r]) = (a[r], a[l])
	l += 1
	r -= 1
for x in a:
	print(x)


from array import *
n = int(input())
a = list(map(int, input().split()))
for i in range(n // 2):
	if i % 2 == 0:
		(a[i], a[n - i - 1]) = (a[n - i - 1], a[i])
for i in range(n):
	print(a[i], end=' ')


import math
n = int(input())
numbers = [0] + list(map(int, input().split()))
steps = n // 2
i = 1
while i <= steps:
	temp = numbers[i]
	numbers[i] = numbers[n - i + 1]
	numbers[n - i + 1] = temp
	i += 2
del numbers[0]
numbers2 = list(map(str, numbers))
print(' '.join(numbers2))


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

def trans(cubes):
	for k in range((n + 1) // 2):
		if k % 2 == 0:
			(cubes[k], cubes[n - k - 1]) = (cubes[n - k - 1], cubes[k])
trans(cubes)
print(' '.join(map(str, cubes)))


n = int(input())
a = ['X'] + [int(x) for x in input().split(' ')]
b = [a[i * (-1) ** i] for i in range(1, n // 2 + 1)]
if n % 2 == 1:
	b += [a[n // 2 + 1]]
b += [a[-i * (-1) ** i] for i in range(1, n // 2 + 1)][::-1]
print(*b)


def lcm(x, y):
	if x > y:
		greater = x
	else:
		greater = y
	while True:
		if greater % x == 0 and greater % y == 0:
			lcm = greater
			break
		greater += 1
	return lcm
nums = int(input())
lst = input().split(' ')
for i in range(nums // 2):
	if i % 2 == 0:
		buf = lst[i]
		lst[i] = lst[nums - i - 1]
		lst[nums - i - 1] = buf
print(' '.join(lst))


n = int(input())
l1 = [int(x) for x in input().split()]
i = 0
while i < len(l1) / 2:
	if i % 2 == 0:
		temp = l1[i]
		l1[i] = l1[-1 - i]
		l1[-1 - i] = temp
	i += 1
print(*l1)


n = int(input())
w = list(map(int, input().split()))
b = -1
e = n
i = 1
while i <= n - i + 1 and b < e:
	b = b + 1
	e = e - 1
	if i % 2 != 0:
		c = w[b]
		w[b] = w[e]
		w[e] = c
	i = i + 1
for i in w:
	print(i, end=' ')


n = int(input())
inp1 = list()
inp1 = input()
inp1 = inp1.split(' ')
for i in range(int(len(inp1) / 2)):
	if i % 2 == 0:
		temp = inp1[i]
		inp1[i] = inp1[n - i - 1]
		inp1[n - i - 1] = temp
print(' '.join(inp1))


n = input()
arr = list(map(int, input().split()))
n = len(arr)
for i in range(int(len(arr) / 2)):
	if int(i % 2) == 0:
		temp = arr[i]
		arr[i] = arr[n - i - 1]
		arr[n - i - 1] = temp
for i in arr:
	print(i, end=' ')


import sys
n = int(sys.stdin.readline())
cubes = list(map(int, sys.stdin.readline().split()))
if n % 2 == 0:
	for c in range(0, n // 2, 2):
		tmp = cubes[c]
		cubes[c] = cubes[-1 - c]
		cubes[-1 - c] = tmp
else:
	for c in range(0, n // 2 + 1, 2):
		tmp = cubes[c]
		cubes[c] = cubes[-1 - c]
		cubes[-1 - c] = tmp
print(' '.join(map(str, cubes)))


n = int(input())
lst = list(map(int, input().split()))
i = 0
while i * 2 < n:
	(lst[i], lst[n - i - 1]) = (lst[n - i - 1], lst[i])
	i += 2
for i in range(n):
	print(lst[i], end=' ')


n = int(input())
number = list(map(int, input().split()))
if n % 2 == 0:
	mid = int(n // 2)
else:
	mid = int((n + 1) // 2)
for i in range(1, mid + 1):
	if i % 2 != 0:
		(number[i - 1], number[n - i]) = (number[n - i], number[i - 1])
for i in number:
	print(i, end=' ')


n = int(input())
a = list(map(int, input().split()))
p = n // 2
t = p % 2
for i in range(t, len(a) // 2, 2):
	(a[i], a[n - i - 1]) = (a[n - i - 1], a[i])
if n // 2 % 2:
	a = a[::-1]
for i in a:
	print(i, end=' ')


n = int(input())
nums = list(map(int, input().split()))
for (index, i) in enumerate(nums):
	if len(nums) / 2 > index:
		if (index + 1) % 2 != 0:
			nums[index] = nums[len(nums) - index - 1]
			nums[len(nums) - index - 1] = i
	print(nums[index])


import sys
n = int(sys.stdin.readline())
cbs = sys.stdin.readline().split()

def swap(x):
	return x % 2 == 0
for i in range(n // 2):
	if swap(i):
		(cbs[i], cbs[n - 1 - i]) = (cbs[n - 1 - i], cbs[i])
print(' '.join(cbs))


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


n = int(input())
l = list(map(int, input().strip().split()[:n]))
for x in range(0, n // 2, 2):
	(l[x], l[len(l) - x - 1]) = (l[len(l) - x - 1], l[x])
print(*l)


n = int(input())
a = list(map(int, input().split()))
for x in range(0, int(n / 2), 2):
	s = 'x = ' + str(x) + ', n-1 - x = ' + str(n - 1 - x)
	(a[x], a[n - 1 - x]) = (a[n - 1 - x], a[x])
s = ''
for x in range(0, n):
	s += str(a[x]) + ' '
print(s)


a = int(input())
l = [int(x) for x in input().split()]
count = 0
b = l.copy()
for i in range(0, a // 2, 2):
	(l[i], l[-1 - i]) = (l[-1 - i], l[i])
print(*l)


n = int(input())
nums = tuple(map(int, str.split(input())))
(head, tail) = ([], [])
for i in range(n // 2):
	if i % 2 == 0:
		head.append(nums[-1 - i])
		tail.append(nums[i])
	else:
		head.append(nums[i])
		tail.append(nums[-1 - i])
if n % 2 == 1:
	head.append(nums[n // 2])
print(str.join(' ', map(str, head + tail[::-1])))


n = int(input())
arr = list(map(int, input().split()))
if n % 2 == 1:
	limit = n // 2 + 1
	j = n - 1
	for i in range(0, limit, 2):
		(arr[i], arr[j]) = (arr[j], arr[i])
		j -= 2
else:
	limit = n // 2
	j = n - 1
	for i in range(0, limit, 2):
		(arr[i], arr[j]) = (arr[j], arr[i])
		j -= 2
for i in arr:
	print(i, end=' ')


import math
length = int(input())
array = list(map(int, input().split()))
for each in range(0, math.ceil(length // 2), 2):
	if each % 2 == 0:
		temp = array[each]
		array[each] = array[length - 1 - each]
		array[length - 1 - each] = temp
for each in array:
	print(each, end=' ')


import math
n = int(input())
arr = [int(inp) for inp in input().split()]
last = int(math.ceil(n / 2))
for i in range(0, last):
	if i % 2 == 0:
		(arr[i], arr[n - i - 1]) = (arr[n - i - 1], arr[i])
for num in arr:
	print(num, end=' ')
print('')


n = int(input(''))
arr = list(map(int, input().split()))
flag = 1
sol = arr.copy()
if n & 1:
	lim = n // 2 + 1
else:
	lim = n // 2
for j in range(lim):
	if flag:
		sol[j] = arr[n - j - 1]
		sol[n - j - 1] = arr[j]
		flag = 0
	else:
		flag = 1
print(*sol)


from math import floor
n = int(input())
array = [int(x.strip()) for x in input().split(' ')]
new_array = [None] * n
for j in range(floor((n + 1) / 2)):
	if j % 2:
		new_array[j] = array[j]
		new_array[n - j - 1] = array[n - j - 1]
	else:
		new_array[j] = array[n - j - 1]
		new_array[n - j - 1] = array[j]
for each in new_array:
	print(each, end=' ')