#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,fma")
using namespace std;
template <typename T>
using vc = vector<T>;
template <typename T>
using uset = unordered_set<T>;
template <typename A, typename B>
using umap = unordered_map<A, B>;
template <typename T>
using pq = priority_queue<T>;
template <typename T>
using minpq = priority_queue<T, vc<T>, greater<T>>;
template <typename T>
inline void sort(vc<T>& v) {
  sort(v.begin(), v.end());
}
template <typename T, typename Comp>
inline void sort(vc<T>& v, Comp c) {
  sort(v.begin(), v.end(), c);
}
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using vi = vc<int>;
using vii = vc<pii>;
constexpr char el = '\n';
constexpr char sp = ' ';
const int N = 101;
int n;
pii a[N];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int x;
    cin >> x;
    a[i].first = x;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n / 2; ++i)
    cout << a[i].second << sp << a[n - i + 1].second << el;
}
