#include <bits/stdc++.h>
using namespace std;
int n;
int arr[101];
bool chk[101];
int main() {
  int sum = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
    sum += arr[i];
  }
  sum /= (n / 2);
  for (int i = 0; i < n - 1; i++) {
    if (chk[i] == true) continue;
    for (int j = i + 1; j < n; j++) {
      if (chk[j] == true) continue;
      if (arr[i] + arr[j] == sum) {
        printf("%d %d\n", i + 1, j + 1);
        chk[i] = chk[j] = true;
        break;
      }
    }
  }
  return 0;
}
