#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, a;
  cin >> n;
  vector<pair<long long, long long>> v;
  for (long long i = 0; i < n; i++) {
    cin >> a;
    v.push_back({a, i + 1});
  }
  sort((v).begin(), (v).end());
  for (long long i = 0; i < n / 2; i++)
    cout << v[i].second << " " << v[n - i - 1].second << endl;
}
