#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  pair<int, int> p[n];
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    p[i].first = x;
    p[i].second = i + 1;
  }
  sort(p, p + n, cmp);
  for (int i = 0; i < n / 2; ++i) {
    cout << p[i].second << ' ' << p[n - i - 1].second << endl;
  }
  return 0;
}
