#include <bits/stdc++.h>
using namespace std;
int fast_mod_exp(long long int x, int n, int d) {
  int res = 1;
  while (n > 0) {
    if (n & 1) res = (res % d * x % d) % d;
    x = (x % d * x % d) % d;
    n = n >> 1;
  }
  return res;
}
long long int mod_inverse(long long int a, long long int m) {
  return fast_mod_exp(a, m - 2, m);
}
int main() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = n - 1; i >= 0; i--) {
    for (long long int j = 0; j <= i; j++) {
      if (a[j] > a[j + 1]) {
        swap(a[j], a[j + 1]);
        cout << j + 1 << " " << j + 2 << endl;
      }
    }
  }
}
