#include <bits/stdc++.h>
inline long long gcd(long long a, long long b) {
  return (b ? gcd(b, a % b) : a);
}
inline long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
inline int cmp(double x, double y = 0, double tol = 1e-7) {
  return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}
using namespace std;
const int MAXN = 300005;
int main() {
  int n;
  cin >> n;
  int v[n];
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  int cont = 0;
  for (int i = 0; i < n; i++) {
    for (int j = n - 1; j > i; j--) {
      if (v[j] < v[j - 1]) {
        cout << j << " " << j + 1 << endl;
        swap(v[j], v[j - 1]);
        cont++;
      }
    }
  }
}
