#include <bits/stdc++.h>
int main() {
  int n, h(0), t;
  std::array<int, 2> a[100];
  std::scanf("%d", &n);
  for (int i(0); i < n; ++i) {
    std::scanf("%d", &a[i][0]);
    a[i][1] = i + 1;
  }
  t = n - 1;
  std::sort(a, a + n);
  while (h < t) {
    std::printf("%d %d\n", a[h][1], a[t][1]);
    ++h, --t;
  }
  return 0;
}
