#include <bits/stdc++.h>
using namespace std;
void FastIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(15);
}
int main() {
  FastIO();
  int n, i, j, val = 0, sum = 0;
  vector<int> a, f;
  cin >> n;
  a.resize(n + 5);
  f.resize(n + 5, 0);
  for (i = 0; i < n; i++) {
    cin >> a[i];
    sum = sum + a[i];
  }
  val = sum / (n / 2);
  for (i = 0; i < n; i++) {
    if (f[i] == 0) {
      f[i] = 1;
      cout << i + 1 << " ";
      for (j = i + 1; j < n; j++) {
        if (f[j] == 0 && a[j] == val - a[i]) {
          f[j] = 1;
          cout << j + 1 << "\n";
          break;
        }
      }
    }
  }
  return 0;
}
