#include <bits/stdc++.h>
using namespace std;
int a[1000], n;
bool t[1000];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int ans = 0;
  for (int i = 1; i <= n; i++) ans += a[i];
  memset(t, true, sizeof(t));
  for (int i = 1; i <= n; i++)
    if (t[i]) {
      t[i] = false;
      cout << i << " ";
      for (int j = 1; j <= n; j++)
        if (t[j] && (a[i] + a[j] == ans / (n / 2))) {
          t[j] = false;
          cout << j << endl;
          break;
        }
    }
}
