#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<int> b = a;
  int k = 0;
  while (k < 20000) {
    bool flag = false;
    for (int i = 0; i < n - 1; i++) {
      if (b[i] > b[i + 1]) {
        cout << i + 1 << " " << i + 2 << endl;
        swap(b[i], b[i + 1]);
        flag = true;
      }
    }
    if (!flag) {
      break;
    }
    k++;
  }
  return 0;
}
