#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  {
    ios::sync_with_stdio(false);
    cin >> n;
    vector<int> v;
    v.resize(n, 0);
    for (int i = 0; i < n; ++i) {
      cin >> v[i];
    }
    for (int i = n; i >= 1; --i) {
      auto p = max_element(v.begin(), v.begin() + i);
      int d = distance(v.begin(), p);
      for (int j = d; j < i - 1; ++j) {
        swap(v[j], v[j + 1]);
        cout << j + 1 << " " << j + 2 << endl;
      }
    }
  }
}
