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