#include <bits/stdc++.h>
using namespace std;
void print(vector<int> v) {
  cout << "|";
  for (int i = 0; i < (int)v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << "|\n";
}
int main() {
  int n;
  cin >> n;
  vector<int> a[101];
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    a[v[i]].push_back(i + 1);
  }
  sort(v.begin(), v.end());
  int x, y;
  for (int i = 0; i < n / 2; i++) {
    x = a[v[i]][a[v[i]].size() - 1];
    a[v[i]].pop_back();
    y = a[v[n - i - 1]][a[v[n - i - 1]].size() - 1];
    a[v[n - i - 1]].pop_back();
    cout << x << " " << y << endl;
  }
  getchar();
  getchar();
  return 0;
}
