#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  long long int i, j, x, n, cnt = 0, m, y, k, g, flg, p;
  cin >> n;
  long long in[n + 1], sr[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> in[i];
    sr[i] = in[i];
  }
  sort(sr + 1, sr + 1 + n);
  for (i = n; i >= 1; i--) {
    x = sr[i];
    for (j = i; j >= 1; j--) {
      if (x == in[j]) {
        p = j;
        break;
      }
    }
    while (p < i) {
      cout << p << " " << p + 1 << endl;
      swap(in[p], in[p + 1]);
      p++;
    }
  }
}
