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