#include <bits/stdc++.h>
using namespace std;
vector<int> a;
int main() {
  int n = 0;
  cin >> n;
  a.assign(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < n - i - 1; j++) {
      if (a[j + 1] < a[j]) {
        int tmp = a[j];
        a[j] = a[j + 1];
        a[j + 1] = tmp;
        cout << (j + 1) << " " << (j + 1 + 1) << "\n";
      }
    }
  }
  return 0;
}
