#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, i, c, d, sum, e, y;
  cin >> n;
  int a[110];
  c = 1000;
  d = 0;
  for (x = 1; x <= n; x++) {
    cin >> a[x];
    c = min(c, a[x]);
    d = max(d, a[x]);
  }
  sum = c + d;
  for (i = 1; i <= n; i++) {
    e = sum - a[i];
    for (y = i + 1; y <= n; y++) {
      if (a[y] == e) {
        a[y] = -1;
        cout << i << ' ' << y << endl;
        break;
      }
    }
  }
  return 0;
}
