#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, temp, c = 0, s = 0, j = 0;
  cin >> n;
  int a[n], b[4000];
  for (i = 0; i < n; i++) cin >> a[i];
  while (1) {
    temp = 1;
    for (i = 1; i < n; i++) {
      if (a[i] < a[i - 1]) {
        if (c == 0) b[j++] = i;
        c = 1;
        int t = a[i];
        a[i] = a[i - 1];
        a[i - 1] = t;
        i++;
        temp = 0;
      } else {
        if (c == 1) {
          b[j++] = i - 1;
          s++;
          c = 0;
          break;
        }
      }
    }
    if (c == 1) {
      b[j++] = i - 1;
      s++;
    }
    c = 0;
    if (temp == 1) break;
  }
  if (s <= 2000)
    for (i = 0; i < j - 1; i += 2) {
      cout << b[i] << " " << b[i + 1] << endl;
    }
  return 0;
}
