#include <bits/stdc++.h>
using namespace std;
int a[105][2];
int main() {
  int n, sum = 0, b = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i][0]);
    sum += a[i][0];
  }
  n /= 2;
  sum = sum / n;
  for (int j = 1; j <= n; j++) {
    for (int i = 1; i <= 2 * n; i++) {
      if (a[i][1] == 0) {
        if (b == 0) {
          printf("%d ", i);
          b = a[i][0];
          a[i][1] = 1;
        } else {
          if (b + a[i][0] == sum) {
            printf("%d\n", i);
            b = 0;
            a[i][1] = 1;
            break;
          }
        }
      }
    }
  }
  return 0;
}
