#include <bits/stdc++.h>
using namespace std;
int n;
int a[100 + 2];
int d[100 + 2];
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  scanf("%d", &n);
  for (register int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    d[i] = i;
  }
  sort(d + 1, d + n + 1, cmp);
  for (register int i = 1; i <= n / 2; ++i) {
    printf("%d %d\n", d[i], d[n - i + 1]);
  }
  return 0;
}
