#!/usr/bin/python n = int(input()) a = list(map(int, input().split())) for i in range(1, 2 * n - 2): #print(i) for p in range(max(0, i - n + 1), (i + 1) // 2): #print (p, i-p) #input() a[p], a[i - p] = min(a[p], a[i - p]), max(a[p], a[i - p]) print(' '.join(list(map(str, a))))