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