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