#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> b, a(n);
  int i;
  for (i = 0; i < n; i++) cin >> a[i];
  b = a;
  int r, l;
  int k;
  stable_sort(b.begin(), b.end());
  while (a != b) {
    i = 0;
    while (i != n - 2 && a[i] <= a[i + 1]) i++;
    l = i;
    while (i < n - 1 && a[i] > a[i + 1]) {
      k = a[i];
      a[i] = a[i + 1];
      a[i + 1] = k;
      i += 2;
    }
    cout << l + 1 << ' ' << i << endl;
  }
  return 0;
}
