#include <bits/stdc++.h>
using namespace std;
const long long N = 1e2 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;
int n;
int a[N];
int b[N];
vector<pair<int, int>> res;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] == b[i]) {
      continue;
    }
    int idx = -1;
    for (int j = i; j <= n; j++) {
      if (b[i] == a[j]) {
        idx = j;
        break;
      }
    }
    while (idx > i) {
      swap(a[idx - 1], a[idx]);
      res.push_back({idx - 1, idx--});
    }
  }
  for (auto x : res) {
    cout << x.first << " " << x.second << "\n";
  }
  cout << "\n";
}
