#include <bits/stdc++.h>
using namespace std;
int n, l;
long long int a[105];
vector<int> v;
bool check(long long int a[]) {
  for (int i = 1; i < n; i++) {
    if (a[i] < a[i - 1]) return false;
  }
  return true;
}
void fun(long long int a[]) {
  int j, i, f, r;
  long long int temp;
  f = 0;
  for (i = l; i < n - 1; i++) {
    if (a[i] > a[i + 1]) {
      r = i + 1;
      f = 1;
      temp = a[i];
      a[i] = a[i + 1];
      a[i + 1] = temp;
      i++;
    } else {
      break;
    }
  }
  if (f == 1) {
    v.push_back(l + 1);
    v.push_back(r + 1);
  }
  if (check(a)) {
    return;
  } else {
    if (f == 0) l++;
    if (f == 1) l = 0;
    fun(a);
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (check(a)) {
    return 0;
  }
  l = 0;
  fun(a);
  if (v.size() <= 40000)
    for (i = 0; i < v.size(); i += 2) {
      cout << v[i] << " " << v[i + 1] << endl;
    }
  return 0;
}
