#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n + 1);
  int i, j;
  for (i = 1; i <= n; i++) cin >> v[i];
  for (i = 1; i <= n; i++) {
    int ind = i;
    long long int min = 100000000000;
    for (j = i; j <= n; j++) {
      if (v[j] < min) {
        min = v[j];
        ind = j;
      }
    }
    while (ind != i) {
      int temp = v[ind];
      v[ind] = v[ind - 1];
      v[ind - 1] = temp;
      cout << ind - 1 << " " << ind << "\n";
      ind--;
    }
  }
  {}
}
