#include <bits/stdc++.h>
using namespace std;
void gnomeSort(int arr[], int n) {
  int index = 0;
  while (index < n) {
    if (index == 0) index++;
    if (arr[index] >= arr[index - 1])
      index++;
    else {
      printf("%d %d\n", index, index + 1);
      swap(arr[index], arr[index - 1]);
      index--;
    }
  }
  return;
}
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  gnomeSort(a, n);
}
