#include <bits/stdc++.h>
using namespace std;
long long t = 1;
void solve() {
  long long n, s = 0, printed = 0;
  cin >> n;
  vector<long long> v(n), vv(n, 0);
  for (long long i = 1; i < n + 1; i += 1) {
    cin >> v[i - 1];
    s += v[i - 1];
  }
  s = (2 * s) / n;
  while (printed < n / 2) {
    for (long long i = 0; i < n; i += 1) {
      if (vv[i] == 0) {
        for (long long j = 0; j < n; j += 1) {
          if (vv[j] == 0 && vv[i] == 0 && v[i] + v[j] == s && i != j) {
            cout << i + 1 << " " << j + 1 << "\n";
            printed++;
            vv[i] = 1;
            vv[j] = 1;
          }
        }
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (t--) solve();
  return 0;
}
