#include <bits/stdc++.h>
using namespace std;
int a[101], sum = 0, used[101] = {0}, n;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  sum /= (n / 2);
  for (int i = 1; i <= n / 2; ++i) {
    int cur = sum;
    for (int j = 1; j <= n; ++j) {
      if (used[j]) continue;
      cur -= a[j];
      used[j] = true;
      cout << j << " ";
      break;
    }
    for (int j = 1; j <= n; ++j) {
      if (used[j]) continue;
      if (cur == a[j]) {
        used[j] = true;
        cout << j << '\n';
        break;
      }
    }
  }
  return 0;
}
