#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int INF = 0x7f7f7f7f;
const double PI = acos(-1.0);
template <class T>
inline T _abs(T n) {
  return ((n) < 0 ? -(n) : (n));
}
template <class T>
inline T _max(T a, T b) {
  return (!((a) < (b)) ? (a) : (b));
}
template <class T>
inline T _min(T a, T b) {
  return (((a) < (b)) ? (a) : (b));
}
template <class T>
inline T _swap(T& a, T& b) {
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
}
template <class T>
inline T gcd(T a, T b) {
  return (b) == 0 ? (a) : gcd((b), ((a) % (b)));
}
template <class T>
inline T lcm(T a, T b) {
  return ((a) / gcd((a), (b)) * (b));
}
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int bitOn(int N, int pos) { return N = N | (1 << pos); }
int bitOff(int N, int pos) { return N = N & ~(1 << pos); }
bool bitCheck(int N, int pos) { return (bool)(N & (1 << pos)); }
int main() {
  int t;
  int n;
  while (cin >> n) {
    int a[n];
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    while (1) {
      int f = 1;
      for (int i = 0; i < n;) {
        int flagg = 1;
        while (i + 1 < n && a[i] <= a[i + 1]) {
          i++;
        };
        int l = i;
        int r = i + 1;
        ;
        int flag = 0;
        while (i + 1 < n && a[i] > a[i + 1]) {
          swap(a[i], a[i + 1]);
          flag = 1;
          r = i + 1;
          i += 2;
        }
        if (flag) {
          while (i + 1 < n && a[i] >= a[i + 1]) {
            swap(a[i], a[i + 1]);
            flag = 1;
            r = i + 1;
            i += 2;
          }
        }
        if (flag) {
          f = 0;
          cout << l + 1 << " " << r + 1 << endl;
        }
        if (i == n - 1) i++;
      };
      if (f == 1) break;
    }
  }
}
