#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const long long INF = 1e9 + 5;
const long long mod = 1e9 + 7;
const double pi = 3.1415926536;
int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  ;
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  bool yes = false;
  while (true) {
    yes = false;
    for (int i = 0; i < n - 1; i++) {
      if (arr[i] > arr[i + 1]) {
        yes = 1;
        cout << i + 1 << " " << i + 2 << "\n";
        swap(arr[i], arr[i + 1]);
      }
    }
    if (!yes) break;
  }
  return 0;
}
