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