from sys import stdin, stdout input = lambda: stdin.readline().rstrip() println = stdout.write def main(): N = int(input()) A = list(map(int, input().split())) ans = yukisort(A) print(*ans) def yukisort(a): n = len(a) a += [float('inf')] * (n - 3) for i in range(1, 2 * n - 3): p, q = 0, i while p < q: if a[p] > a[q]: a[p], a[q] = a[q], a[p] p += 1 q -= 1 return a[:n] main()