#include <bits/stdc++.h>
using namespace std;
int main() {
  int l1;
  cin >> l1;
  int r1[l1 + 5];
  vector<pair<int, int> > v;
  for (int i = 1; i <= l1; i++) {
    cin >> r1[i];
    v.push_back(make_pair(r1[i], i));
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < l1 / 2; i++) {
    cout << v[i].second << " " << v[l1 - i - 1].second << endl;
  }
}
