#include <bits/stdc++.h>
using namespace std;
map<int, int> loc;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  int a[n], b[n];
  for (int i = 0; i < n; i++) cin >> a[i], b[i] = a[i];
  sort(b, b + n);
  for (int i = 0; i < n; i++) {
    int loc = 0, Min = 1e9 + 9;
    if (a[i] == b[i]) continue;
    for (int j = i; j < n; j++) {
      if (a[j] < Min) Min = a[j], loc = j;
    }
    while (loc > i) {
      if ((loc - i + 1) % 2 == 0) {
        for (int k = loc; k > i; k -= 2) swap(a[k], a[k - 1]);
        cout << i + 1 << " " << loc + 1 << endl;
        loc--;
      } else {
        if (loc < n - 1) {
          swap(a[loc], a[loc - 1]);
          cout << loc << " " << loc + 1 << endl;
        } else {
          for (int k = loc; k > i + 1; k -= 2) swap(a[k], a[k - 1]);
          cout << i + 2 << " " << loc + 1 << endl;
        }
        loc--;
      }
    }
  }
  return 0;
}
