#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum, n, a[200];
  scanf("%d", &n);
  sum = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  sum /= (n / 2);
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++)
      if (a[j] >= 1 && a[i] + a[j] == sum) {
        cout << i << " " << j << endl;
        a[i] = a[j] = -1;
      }
  }
  return 0;
}
