#include <bits/stdc++.h>
using namespace std;
bool* sieve() {
  bool* arr = new bool[10000001];
  for (int i = 0; i < 10000000; i++) arr[i] = true;
  for (int i = 2; i * i < 10000000; i++) {
    if (arr[i]) {
      for (int p = i * 2; p <= 10000000; p += i) arr[p] = false;
    }
  }
  return arr;
}
int main() {
  int n;
  while (cin >> n) {
    int arr[101];
    for (int i = 0; i < n; i++) cin >> arr[i];
    bool flag = false;
    vector<pair<int, int> > operations;
    while (!flag) {
      flag = true;
      for (int i = 0; i < n - 1; i++) {
        if (arr[i] > arr[i + 1]) {
          flag = false;
          swap(arr[i], arr[i + 1]);
          operations.push_back(make_pair(i + 1, i + 2));
          break;
        }
      }
    }
    for (int i = 0; i < operations.size(); i++)
      cout << operations[i].first << " " << operations[i].second << endl;
  }
  return 0;
}
