#include <bits/stdc++.h>
using namespace std;
const int si = 1e5 + 7;
const int mod = 1e9 + 7;
long long int fexpo(long long int a, long long int b) {
  if (b == 1) return a;
  if (b == 2) return a * a;
  if (b % 2 == 0)
    return fexpo(fexpo(a, b / 2), 2);
  else
    return a * fexpo(fexpo(a, (b - 1) / 2), 2);
}
vector<pair<long long int, long long int> > arc;
int main() {
  int n;
  cin >> n;
  int ar[1011];
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
  }
  for (int i = 1; i <= n; i++) {
    int min = ar[i], first = i;
    for (int j = i; j <= n; j++) {
      if (ar[j] < ar[first]) {
        first = j;
      }
      if (first != i) {
        while (first > i) {
          swap(ar[first], ar[first - 1]);
          arc.push_back(make_pair(first - 1, first));
          first--;
        }
      }
    }
  }
  for (int i = 0; i < (int)arc.size(); i++) {
    cout << arc[i].first << " ";
    cout << arc[i].second << endl;
  }
  return 0;
}
