#include <bits/stdc++.h>
const long long mod = (long long)1e9 + 7;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<long long> arr(n);
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long f = 0, m = 0;
  while (f < n) {
    m = 0;
    for (long long i = n - 1; i > f; i--) {
      if (arr[i] < arr[f]) {
        m = i;
        break;
      }
    }
    if (m != 0) {
      for (long long i = f; i < m; i++) {
        cout << i + 1 << " " << i + 2 << '\n';
        swap(arr[i], arr[i + 1]);
      }
    } else
      f++;
  }
  return 0;
}
