#include <bits/stdc++.h>
using namespace std;
vector<int> a;
vector<pair<int, int> > s;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n - 1; j++) {
      if (a[j] > a[j + 1]) {
        swap(a[j], a[j + 1]);
        s.push_back({j + 1, j + 2});
      }
    }
  }
  for (auto a : s) {
    cout << a.first << " " << a.second << "\n";
  }
}
