#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 100500;
const int maxn = 100500;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > arr;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    arr.push_back(pair<int, int>(temp, i + 1));
  }
  sort(arr.begin(), arr.end());
  for (int i = 0; i < n / 2; i++)
    cout << arr[i].second << " " << arr[n - 1 - i].second << endl;
  return 0;
  return 0;
}
