#include <bits/stdc++.h>
using namespace std;
int n, pos[1005], a[1005];
pair<int, int> p[1005];
void setup() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> p[i].first;
    p[i].second = i;
  }
  sort(p + 1, p + n + 1);
  for (int i = 1; i <= n; i++) {
    pos[i] = p[i].second;
    a[p[i].second] = i;
  }
}
void xuly() {
  for (int i = 1; i <= n; i++) {
    while (pos[i] != i) {
      cout << pos[i] - 1 << ' ' << pos[i] << '\n';
      int pre = a[pos[i] - 1];
      a[++pos[pre]] = pre;
      a[--pos[i]] = i;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  setup();
  xuly();
  return 0;
}
