#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
struct Node {
  int point;
  int data;
} nod[maxn];
bool cmp(struct Node a, struct Node b) { return a.data < b.data; }
int main() {
  int n;
  while (cin >> n) {
    for (int i = 0; i < n; i++) {
      cin >> nod[i].data;
      nod[i].point = i + 1;
    }
    sort(nod, nod + n, cmp);
    for (int i = 0, j = n - 1; i < j; i++, j--)
      cout << nod[i].point << " " << nod[j].point << endl;
  }
  return 0;
}
