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