#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
};
queue<node> Q;
int sum;
int a[310];
int b[310];
void func(int i, int j) {
  node pre;
  while (i != j) {
    pre.x = j;
    pre.y = j - 1;
    int temp = b[j];
    b[j] = b[j - 1];
    b[j - 1] = temp;
    Q.push(pre);
    j--;
  }
}
int main() {
  int i, j, k, n;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (i = 0; i < n; i++) {
    if (b[i] == a[i]) {
      continue;
    }
    for (j = i + 1; j < n; j++) {
      if (b[j] == a[i]) {
        func(i, j);
        break;
      }
    }
  }
  printf("%d\n", Q.size());
  while (Q.size()) {
    node pre;
    pre = Q.front();
    Q.pop();
    printf("%d %d\n", pre.y + 1, pre.x + 1);
  }
  return 0;
}
