#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  if (n == 1) {
    return 0;
  }
  vector<long long> v(n + 1);
  v[0] = -10000000000;
  for (long long i = 1; i <= n; i++) {
    cin >> v[i];
  }
  for (int i = 2; i <= n; i++) {
    int tmp = i;
    while (v[tmp] < v[tmp - 1]) {
      swap(v[tmp], v[tmp - 1]);
      cout << tmp - 1 << " " << tmp << endl;
      tmp--;
    }
  }
}
