""" """ from sys import stdin from collections import deque N = int(stdin.readline()) A = list(map(int,stdin.readline().split())) Ai = [(A[i],i+1) for i in range(N)] Ai.sort() Ai.reverse() q = deque([]) for na,ni in Ai: if len(q) % 2 == 0: q.append(ni) else: q.appendleft(ni) ans = list(q) for i in range(N): if ans[i] == 1: ans = ans[i:] + ans[:i] break ans.append(1) print (*ans)