import numpy as np N = int(input()) A = np.fromstring(input(), dtype=int, sep=" ") sorted_order = np.argsort(A) + 1 answer_order = np.concatenate([sorted_order[::2], sorted_order[1::2][::-1]]) one_key = np.where(answer_order == 1)[0][0] ans = np.roll(answer_order, -one_key) ans = np.append(ans, 1) print(*ans)