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