n = int(input())
a = list(map(int, input().split()))
a.sort()
v = []
l, r = 0, n - 1
f = 0
while l < r:
    if f:
        v.append(a[l])
        l += 1
    else:
        v.append(a[r])
        r -= 1
    f = 1 - f
v.append(a[l])
print(" ".join(map(str, v)))

