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