#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, flag = 0, p = 0;
  cin >> n;
  pair<int, int> v[20055];
  long long int arr[1000];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  p = 0;
  for (int i = 0; i < n - 1;) {
    if (arr[i + 1] < arr[i]) {
      flag = 1;
      v[p].first = i + 1;
      v[p].second = i + 2;
      for (int j = i + 2; j < n - 1; j = j + 2) {
        if (arr[j + 1] < arr[j]) {
          v[p].second = j + 2;
        }
      }
      for (int k = v[p].first - 1; k < v[p].second - 1; k = k + 2) {
        swap(arr[k], arr[k + 1]);
      }
      p++;
      i = 0;
    } else {
      i++;
    }
  }
  if (flag == 1) {
    for (int i = 0; i < p; i++) {
      cout << v[i].first << " " << v[i].second << "\n";
    }
  }
  return 0;
}
