#include <bits/stdc++.h>
using namespace std;
void SO() { cout << endl; }
template <typename S, typename... Strings>
void SO(S x, const Strings &...rest) {
  cout << x << ' ';
  SO(rest...);
}
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000;
const int v9 = 1000000000;
const int v6 = 1000000;
inline void AI(long int x[], long int n) {
  for (long int i = 0; i < (n); ++i) cin >> (x[i]);
}
inline void VI(vector<long int> &arr, long int n) {
  for (long int i = 0; i < (n); ++i) {
    long int x;
    cin >> (x);
    arr.push_back(x);
  };
}
long int n, m, k, c = 0;
long int a[4000001];
map<long int, vector<long int> > g;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> (n);
  AI(a, n);
  for (int i = (0); i < (n - 1); ++i) {
    for (int j = (0); j < (n - i - 1); ++j) {
      if (a[j + 1] < a[j]) {
        SO(j + 1, j + 2);
        k = a[j];
        a[j] = a[j + 1];
        a[j + 1] = k;
      }
    }
  }
  return 0;
}
