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