#include <bits/stdc++.h>
using namespace std;
long long int arr[1000];
int main() {
  long long int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  long long int lo = 1, hi = 1;
  long long int cnt = 0, okk = 1;
  while (true) {
    cnt = 0, okk = 1;
    hi = 0;
    lo = 0;
    for (int i = 1; i <= (n - 1); i++) {
      if (arr[i] > arr[i + 1]) {
        swap(arr[i], arr[i + 1]);
        cnt++;
        if (cnt == 1) lo = i;
        hi = i + 1;
        i++;
      } else {
        okk++;
      }
      if ((hi - lo + 1) % 2 == 0 && hi != lo) break;
    }
    if (okk == n) break;
    if (lo != 0 && hi != 0) cout << lo << " " << hi << endl;
  }
  return 0;
}
