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