#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long int> v(n, 0), w(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    w[i] = v[i];
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < n - 1; j++) {
      if (w[j] < w[j + 1]) {
        long int aux = w[j + 1];
        w[j + 1] = w[j];
        w[j] = aux;
      }
    }
  }
  int total = 0;
  for (int i = 0; i < n; i++) {
    int j = 0;
    while (v[j] != w[i]) j = j + 1;
    for (int k = j; k < n - 1 - i; k++) {
      cout << k + 1 << " " << k + 2 << endl;
      long int aux = v[k + 1];
      v[k + 1] = v[k];
      v[k] = aux;
    }
  }
  return 0;
}
