#include <bits/stdc++.h>
using namespace std;
void swap(int &a, int &b) {
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
  return;
}
void get_output(int arr[], int n) {
  int flag = 1;
  while (flag) {
    flag = 0;
    for (int i = 0; i < n - 1; i++) {
      if (arr[i] > arr[i + 1]) {
        swap(arr[i], arr[i + 1]);
        cout << i + 1 << " " << i + 2 << endl;
        flag = 1;
      }
    }
  }
  return;
}
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  get_output(arr, n);
  return 0;
}
