#include <bits/stdc++.h>
using namespace std;
void sort(int A[], int l, int r) {
  if (r - l < 2) {
    return;
  }
  int mid = (r + l) / 2;
  sort(A, l, mid);
  sort(A, mid, r);
  int B[r - l];
  int x = l;
  int y = mid;
  for (int i = 0; i < r - l; i++) {
    if (A[x] <= A[y] && x < mid && y < r) {
      B[i] = A[x];
      x++;
    } else if (y < r) {
      B[i] = A[y];
      y++;
    } else {
      B[i] = A[x];
      x++;
    }
  }
  for (int i = 0; i < r - l; i++) A[l + i] = B[i];
}
int main() {
  int n, x[200], s = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    s += x[i];
  }
  for (int i = 0; i < n; i++) {
    if (x[i] != -1) {
      for (int j = 0; j < n; j++) {
        if (x[i] + x[j] == (s * 2) / n && x[j] != -1 && i != j) {
          cout << i + 1 << ' ' << j + 1 << '\n';
          x[i] = -1;
          x[j] = -1;
          break;
        }
      }
    }
  }
  return 0;
}
