#include <bits/stdc++.h>
const double pi = acos(-1.0), e = exp(1.0);
using namespace std;
struct data {
  int x, y;
  data(int _x = 0, int _y = 0) : x(_x), y(_y) {}
};
int a[310], b[310];
vector<data> p;
int main() {
  int N, i, j;
  scanf("%d", &N);
  for (i = 1; i <= N; i++) scanf("%d", &a[i]);
  for (i = 1; i <= N; i++) scanf("%d", &b[i]);
  for (i = 1; i <= N; i++)
    if (b[i] != a[i]) {
      for (j = i + 1; j <= N; j++)
        if (b[j] == a[i]) {
          int t = j;
          while (t != i) {
            p.push_back(data(t - 1, t));
            swap(b[t], b[t - 1]);
            t--;
          }
          break;
        }
    }
  printf("%d\n", p.size());
  for (i = 0; i < p.size(); i++) printf("%d %d\n", p[i].x, p[i].y);
}
