#include <bits/stdc++.h>
using namespace std;
int a[110], b[110];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] == b[i]) continue;
    for (int j = i + 1; j <= n; j++) {
      if (a[j] == b[i]) {
        for (int k = 1; k <= j - i; k++) {
          cout << j - k << " " << j - k + 1 << endl;
          swap(a[j - k], a[j - k + 1]);
        }
        break;
      }
    }
  }
  cerr << a[3] << b[3];
  return 0;
}
