#include <bits/stdc++.h>
int main() {
  unsigned short n;
  unsigned short pl;
  unsigned short s;
  unsigned short i;
  unsigned short a[100];
  unsigned short d[100];
  unsigned short sp;
  unsigned short j;
  unsigned short ar;
  unsigned short k;
  unsigned short c[50][2];
  if (scanf("%hu", &n) != 1) return -1;
  if (n < 2 || n > 100) return -1;
  if (n % 2) return -1;
  pl = n / 2;
  s = 0;
  for (i = 0; i < n; i++) {
    if (scanf("%hu", &a[i]) != 1) return -1;
    if (a[i] < 1 || a[i] > 100) return -1;
    d[i] = 0;
    s += a[i];
  }
  if (s % pl) return -1;
  sp = s / pl;
  j = 0;
  for (i = 0; i < pl; i++) {
    while (d[j]) j++;
    d[j] = 1;
    if (a[j] >= sp) return -1;
    ar = sp - a[j];
    for (k = j + 1; k < n && (d[k] || a[k] != ar); k++)
      ;
    if (k == n) return -1;
    d[k] = 1;
    c[i][0] = j + 1;
    c[i][1] = k + 1;
  }
  for (i = 0; i < pl; i++) printf("%hu %hu\n", c[i][0], c[i][1]);
  return 0;
}
