#include <bits/stdc++.h>
using namespace std;
int n, l, r;
int a[105];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    bool ok;
    while (true) {
      l = 0;
      ok = true;
      int i = 1;
      while (i < n) {
        if (a[i] > a[i + 1]) {
          swap(a[i], a[i + 1]);
          ok = false;
          if (!l) l = i;
          r = i + 1;
          i += 2;
        } else {
          if (l) printf("%d %d\n", l, r);
          l = 0;
          i++;
        }
      }
      if (l) printf("%d %d\n", l, r);
      if (ok) break;
    }
  }
}
