#include <bits/stdc++.h>
using namespace std;
bool chk(vector<int> &A) {
  for (int i = 0; i < A.size() - 1; i++) {
    if (A[i] > A[i + 1]) return 1;
  }
  return 0;
}
int main() {
  int n, in;
  cin >> n;
  vector<int> v;
  while (n--) {
    cin >> in;
    v.push_back(in);
  }
  while (chk(v)) {
    for (int i = 0; i < v.size() - 1; i++) {
      if (v[i] > v[i + 1]) {
        int temp = v[i];
        v[i] = v[i + 1];
        v[i + 1] = temp;
        cout << i + 1 << " " << i + 2 << endl;
      }
    }
  }
  return 0;
}
