from collections import * N = int(input()) A = list(map(int, input().split())) D = deque() B = [] for i in range(N): B.append((A[i], i + 1)) B.sort(reverse=True) for i in range(N): if i % 2: D.append(B[i][1]) else: D.appendleft(B[i][1]) D = list(D) ind = D.index(1) ans = D[ind:] + D[:ind] + [1] print(*ans)