#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  std::ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> heights;
  for (int i = 0; i < n; i++) {
    int aux;
    cin >> aux;
    heights.push_back(aux);
  }
  bool ok1 = true;
  while (ok1) {
    ok1 = false;
    for (int i = 0; i < n - 1; i++) {
      if (heights[i] > heights[i + 1]) {
        ok1 = true;
        int tmp = heights[i];
        heights[i] = heights[i + 1];
        heights[i + 1] = tmp;
        cout << i + 1 << ' ' << i + 2 << '\n';
      }
    }
  }
  return 0;
}
