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