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