#include <bits/stdc++.h>
using namespace std;
struct G {
  int a, b;
  G(int _a, int _b) {
    a = _a;
    b = _b;
  }
};
vector<G> ans;
int a[110], chk[110];
int main() {
  int n, sum = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  sum *= 2;
  sum = sum / n;
  for (int i = 1; i <= n; i++) {
    if (chk[i] == 1) continue;
    chk[i] = 1;
    for (int j = 1; j <= n; j++) {
      if (a[i] + a[j] == sum && chk[j] == 0) {
        ans.push_back(G(i, j));
        chk[j] = 1;
        break;
      }
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    printf("%d %d\n", ans[i].a, ans[i].b);
  }
  return 0;
}
