#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, a[101];
  cin >> n;
  bool check = true;
  a[0] = -1;
  a[n + 1] = 2000000001;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] < a[i - 1]) check = false;
  }
  bool checki = true;
  if (check)
    return 0;
  else {
    while (checki) {
      for (int i = 1; i <= n; i += 2) {
        if (a[i] > a[i + 1]) {
          cout << i << " " << i + 1 << endl;
          swap(a[i], a[i + 1]);
        }
      }
      for (int i = 2; i <= n; i += 2) {
        if (a[i] > a[i + 1]) {
          cout << i << " " << i + 1 << endl;
          swap(a[i], a[i + 1]);
        }
      }
      bool kk = true;
      for (int i = 2; i <= n; i++) {
        if (a[i - 1] > a[i]) kk = false;
      }
      if (kk) checki = false;
    }
  }
}
