#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long n;
struct arr {
  int val, pos;
};
arr v[102];
bool cmp(arr a, arr b) { return a.val < b.val; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> v[i].val, v[i].pos = i;
  sort(v + 1, v + n + 1, cmp);
  for (int i = 1; i <= n / 2; ++i)
    cout << v[i].pos << " " << v[n - i + 1].pos << '\n';
  return 0;
}
