#include <bits/stdc++.h>
using namespace std;
int mult(int x, int y) {
  long long int ans, x1 = (long long int)x, y1 = (long long int)y;
  ans = (x1 * y1) % 1000000007;
  return (int)ans;
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
int pow1(int a, int b) {
  int ans = 1;
  while (b > 0) {
    if (b & 1) ans = mult(ans, a);
    a = mult(a, a);
    b >>= 1;
  }
  return ans;
}
int mina(int arr[], int n) {
  int x = arr[0], i, pos = 0;
  for (i = 1; i < n; i++) {
    if (arr[i] < x) {
      x = arr[i];
      pos = i;
    }
  }
  return pos;
}
int maxa(int arr[], int n) {
  int x = arr[0], i, pos = 0;
  for (i = 1; i < n; i++) {
    if (arr[i] >= x) {
      x = arr[i];
      pos = i;
    }
  }
  return pos;
}
int arr[1000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = n - 1; i > 0; i--) {
    int index = maxa(arr, i + 1);
    for (int j = index; j < i; j++) {
      int temp = arr[j];
      arr[j] = arr[j + 1];
      arr[j + 1] = arr[j];
      cout << j + 1 << " " << j + 2 << '\n';
    }
  }
  return 0;
}
