#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int x;
  scanf("%d", &x);
  return x;
}
const int INF = 1e9 + 10;
const long long LINF = 1000ll * 1000 * 1000 * 1000 * 1000 * 1000 + 100;
const int MN = 1e2 + 10;
bool mk[MN];
vector<pair<int, int> > ans;
int arr[MN];
int n;
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  long long s = 0;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    s += arr[i];
  }
  long long t = s / (n / 2);
  for (int i = 0; i < n; ++i) {
    if (mk[i]) continue;
    for (int j = i + 1; j < n; ++j) {
      if (mk[j]) continue;
      if (arr[i] + arr[j] == t) {
        ans.push_back(pair<int, int>(i, j));
        mk[i] = mk[j] = true;
        break;
      }
    }
  }
  for (int i = 0; i < ((int)(ans).size()); ++i)
    cout << ans[i].first + 1 << ' ' << ans[i].second + 1 << '\n';
  return 0;
}
