#include <bits/stdc++.h>
using namespace std;
struct haha {
  int wei, zhi;
} a[105];
int my_comp(const haha &q, const haha &w) {
  if (q.zhi < w.zhi) return 1;
  return 0;
}
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i].zhi);
    a[i].wei = i;
  }
  sort(a + 1, a + n + 1, my_comp);
  int r = n;
  int k = n / 2;
  for (int i = 1; i <= k; ++i) printf("%d %d\n", a[i].wei, a[r - i + 1].wei);
  return 0;
}
