#include <bits/stdc++.h>
using namespace std;
int temp;
int n, m, k;
int arr[101];
int res[101];
void sortV() {
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      if (arr[i] > arr[j]) {
        int temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
        temp = res[i];
        res[i] = res[j];
        res[j] = temp;
      }
    }
}
int main(int argc, const char* argv[]) {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    arr[i] = temp;
    res[i] = i + 1;
  }
  sortV();
  for (int i = 0; i < (n / 2); i++) {
    cout << res[i] << " " << res[n - i - 1] << endl;
  }
  return 0;
}
