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