#include <bits/stdc++.h>
using namespace std;
int n;
struct ma {
  int x, vt;
} a[105];
bool cmp(ma p, ma y) { return p.x < y.x; }
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].x;
    a[i].vt = i;
  }
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n / 2; i++)
    cout << a[i].vt << " " << a[n - i + 1].vt << endl;
  return 0;
}
