#include <bits/stdc++.h>
int main() {
  int n, i, j, a, b, temp, l[20000], r[20000], c, swap, left, rit;
  while (scanf("%d", &n) != EOF) {
    int ara[n];
    for (i = 0; i < n; i++) {
      scanf("%d", &ara[i]);
    }
    c = 0;
    swap = 1;
    while (swap) {
      swap = 0;
      for (i = 0; i < n - 1; i++) {
        if (ara[i] > ara[i + 1]) {
          left = i + 1;
          rit = i + 2;
          swap = 1;
          for (j = i + 2; j < n - 1; j += 2) {
            if (ara[j] > ara[j + 1])
              rit += 2;
            else
              break;
          }
          l[c] = left;
          r[c] = rit;
          c++;
          for (j = left - 1; j < rit - 1; j += 2) {
            temp = ara[j + 1];
            ara[j + 1] = ara[j];
            ara[j] = temp;
          }
        }
      }
    }
    if (i == n - 1)
      for (i = 0; i < c; i++) {
        printf("%d %d\n", l[i], r[i]);
      }
  }
  return 0;
}
