#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> v, ord;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    ord.push_back(x);
    v.push_back(x);
  }
  sort(ord.begin(), ord.end());
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      if (v[j] == ord[i]) {
        for (int k = j; k > i; k--) {
          swap(v[k], v[k - 1]);
          cout << k << " " << k + 1 << "\n";
        }
        break;
      }
    }
  }
  return 0;
}
