import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N = int(readline()) A = np.array(read().split(),np.int64) for i in range(1,N+N-3): left = 0 if i<=N-1 else i+1-N right = i-left+1 sub = A[left:right].copy() x = np.maximum(sub, sub[::-1]) y = np.minimum(sub, sub[::-1]) mid = (left+right)//2 A[left:mid] = y[:mid-left] A[mid:right] = x[:right-mid][::-1] print(' '.join(A.astype(str)))