#include <bits/stdc++.h>
using namespace std;
bool ip(long long n) {
  if (n <= 1) return false;
  if (n == 2) return true;
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long p0wm(long long n, long long p, long long m) {
  if (p == 0) return 1;
  if (p == 1) return n % m;
  if (p % 2 == 0) {
    long long t = p0wm(n, p / 2, m);
    return t % m * t % m % m;
  }
  long long t = p0wm(n, p / 2, m);
  t = t % m * t % m % m;
  return t % m * n % m % m;
}
long long p0w(long long n, long long p) {
  if (p == 0) return 1;
  if (p == 1) return n;
  if (p % 2 == 0) {
    long long t = p0w(n, p / 2);
    return t * t;
  }
  long long t = p0w(n, p / 2);
  return t * t * n;
}
long long m0d(long long n, long long m) { return (m + (n % m)) % m; }
vector<bool> ps(long long n) {
  vector<bool> p;
  for (long long i = 0; i < n + 1; i++) {
    p.push_back(true);
  }
  p[0] = false;
  p[1] = false;
  for (long long i = 2; i * i <= n; i++) {
    if (p[i]) {
      for (long long j = i * i; j <= n; j += i) {
        p[j] = false;
      }
    }
  }
  return p;
}
vector<long long> psp(long long n) {
  vector<bool> p = ps(n);
  vector<long long> a;
  for (long long i = 0; i < n + 1; i++)
    if (p[i]) a.push_back(i);
  return a;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, x;
  cin >> n;
  pair<long long, long long> a[n];
  for (long long i = 0; i < n; i++) {
    cin >> x;
    a[i] = make_pair(x, i + 1);
  }
  sort(a, a + n);
  for (long long i = 0; i < n / 2; i++) {
    cout << a[i].second << " " << a[n - 1 - i].second << endl;
  }
  return 0;
}
