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