#include <bits/stdc++.h>
using namespace std;
struct node {
  int num, id;
} a[110];
int cmp(node a, node b) { return a.num < b.num; }
int main() {
  int n, i, ave, sum;
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; ++i) {
      scanf("%d", &a[i].num);
      a[i].id = i + 1;
    }
    sort(a, a + n, cmp);
    for (i = 0; i < n / 2; ++i) printf("%d %d\n", a[i].id, a[n - 1 - i].id);
  }
  return 0;
}
