#include <bits/stdc++.h>
using namespace std;
int n;
int sum;
vector<int> v[111];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    sum += x;
    v[x].push_back(i + 1);
  }
  sum *= 2;
  sum /= n;
  for (int i = 1; i <= 100; i++) {
    while (v[i].size()) {
      cout << v[i].back();
      v[i].pop_back();
      cout << " ";
      cout << v[sum - i].back() << endl;
      v[sum - i].pop_back();
    }
  }
  return 0;
}
