#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, i, j, k, p;
  cin >> x;
  int a[x], b[x];
  for (i = 0; i < x; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + x);
  for (i = 0; i < x; i++) {
    if (b[i] == a[i]) continue;
    for (j = i; j < x; j++) {
      if (b[i] == a[j]) {
        while (j > i) {
          cout << j << " " << j + 1 << endl;
          swap(a[j], a[j - 1]);
          j--;
        }
        break;
      }
    }
  }
}
