#include <bits/stdc++.h>
using namespace std;
void pairsort(long long int arr[], long long int index[], long long int n) {
  pair<int, int> p[n];
  for (long long int i = 0; i < n; i++) {
    p[i].first = arr[i];
    p[i].second = index[i];
  }
  sort(p, p + n);
  for (long long int i = 0; i < n; i++) {
    arr[i] = p[i].first;
    index[i] = p[i].second;
  }
}
int main() {
  long long int n;
  cin >> n;
  long long int arr[n], index[n];
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
    index[i] = i + 1;
  }
  pairsort(arr, index, n);
  for (long long int i = 0; i < (n / 2); i++) {
    cout << index[i] << " " << index[n - i - 1] << "\n";
  }
}
