#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4;
const long long maxValue = 1e10;
long long arr1[maxn];
int swaps[maxn];
bool isOrdered(long n) {
  for (int i = 0; i < n - 1; i++) {
    if (arr1[i] > arr1[i + 1]) return false;
  }
  return true;
}
void swapList(int start) {
  long long help;
  help = arr1[start + 1];
  arr1[start + 1] = arr1[start];
  arr1[start] = help;
}
void show(int n) {
  cout << endl;
  for (int i = 0; i < n; i++) cout << swaps[i] << ' ';
  cout << endl;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr1[i];
  int andis = 0, swapsAndis = 0;
  if (not isOrdered(n)) {
    while (not isOrdered(n)) {
      if (arr1[andis] > arr1[andis + 1]) {
        swapList(andis);
        swaps[swapsAndis++] = andis;
        swaps[swapsAndis++] = andis + 1;
      }
      andis += 1;
      if (andis + 1 == n) andis = 0;
    }
    int start1 = 0;
    int _end_1 = 1;
    int start = 0, _end_ = 1;
    for (int i = 0; i <= swapsAndis; i++) {
      if (swaps[_end_1 + 1] - swaps[_end_1] == 1) {
        _end_1 = _end_1 + 2;
      } else {
        cout << swaps[start1] + 1 << ' ' << swaps[_end_1] + 1;
        if (_end_1 + 2 < swapsAndis) cout << endl;
        start1 = _end_1 + 1;
        _end_1 = start1 + 1;
      }
      if (start1 >= swapsAndis) break;
    }
  }
}
