#include <bits/stdc++.h>
using namespace std;
int p[105][105], top[105] = {0};
void stack_push(int n, int j) {
  p[n][top[n]] = j;
  top[n]++;
}
int main() {
  int n, arr[105];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    stack_push(arr[i], i);
  }
  sort(arr + 1, arr + n + 1);
  for (int i = 1; i <= n; i++) {
    if (top[arr[i]] >= 0 && top[arr[n]] >= 0) {
      cout << p[arr[i]][--top[arr[i]]] << " " << p[arr[n]][--top[arr[n]]]
           << endl;
      n--;
    }
  }
  return 0;
}
