#include <bits/stdc++.h>
using namespace std;
int a[3000003], b[3000003], x;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      for (int j = i + 1; j < n; j++) {
        if (b[j] == a[i]) {
          x = j;
          break;
        }
      }
      while (x > i) {
        cout << x << " " << x + 1 << "\n";
        swap(b[x], b[x - 1]);
        x--;
      }
    }
  }
}
