#include <bits/stdc++.h>
using namespace std;
int locate(int ed, int *t) {
  int maxn = 0, lctn;
  for (int i = 1; i <= ed; i++)
    if (t[i] >= maxn) (maxn = t[i], lctn = i);
  return lctn;
}
int main() {
  int n, a[110]{};
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = n; i >= 1; i--) {
    int k = locate(i, a);
    for (int j = k; j <= i - 1; j++) {
      printf("%d %d\n", j, j + 1);
      swap(a[j], a[j + 1]);
    }
  }
}
