#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, a[105], sum = 0;
  cin >> n;
  t = n / 2;
  for (int i = 1; i <= n; ++i) cin >> a[i], sum += a[i];
  sum /= t;
  for (int i = 1; i <= n; ++i) {
    if (a[i] != 0) {
      cout << i << " ";
      for (int j = 1; j <= n; ++j) {
        if (a[j] != 0 && i != j && a[j] + a[i] == sum) {
          cout << j << endl;
          a[i] = a[j] = 0;
          break;
        }
      }
    }
  }
  return 0;
}
