#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4;
int n;
int a[maxn], b[maxn];
void output(int l, int r) {
  for (; l < r; ++l) {
    printf("%d %d\n", l + 1, l + 2);
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  for (int i = n - 1; i >= 0; --i) {
    int j = -1, x = b[i];
    for (j = i; j >= 0 && a[j] != x; --j)
      ;
    if (j == -1) continue;
    output(j, i);
    memmove(a + j, a + j + 1, sizeof(int) * (i - j));
    a[i] = x;
  }
}
