#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  long long arr[n];
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long k = n / 2;
  long long s = 0;
  for (long long i = 0; i < n; i++) {
    s += arr[i];
  }
  long long sum = s / k;
  long long count = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      if (arr[j] == sum - arr[i] and arr[j] != -1 and arr[i] != -1) {
        cout << i + 1 << " " << j + 1 << "\n";
        arr[j] = arr[i] = -1;
      }
    }
  }
  return 0;
}
