#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, k, p, t = 0;
  map<long long, long long> mp, bp;
  map<long long, long long>::iterator it;
  vector<pair<long long, long long> > v;
  cin >> n;
  long long a[n + 1];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    v.push_back(make_pair(a[i], i + 1));
  }
  sort(v.begin(), v.end());
  for (i = 0; i < n / 2; i++) {
    cout << v[i].second << " " << v[n - i - 1].second << endl;
  }
}
