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