#!/usr/bin/env python3
from math import atan2

n, ps = int(input()), list(enumerate(map(int, input().split()), start=1))
for a, b in sorted(ps, key=lambda x: (-max(abs(v - n // 2) for v in x) // (n ** 0.5), atan2(*(v - n // 2 for v in x)))):
    print(f"{a} {b}")

# import matplotlib.pyplot as plt
# xs, ys = zip(*res)
# plt.plot(xs, ys)
# plt.savefig("plot.png")
