#include <bits/stdc++.h>
using namespace std;
int n, i, j, z;
int A[301], B[301], R[1000000];
int main() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &A[i]);
  for (i = 0; i < n; i++) scanf("%d", &B[i]);
  for (i = 0; i < n; i++) {
    for (j = i; B[j] != A[i]; j++)
      ;
    while (j > i) {
      j--;
      R[z++] = j;
      swap(B[j], B[j + 1]);
    }
  }
  printf("%d\n", z);
  for (i = 0; i < z; i++) printf("%d %d\n", R[i] + 1, R[i] + 2);
  return 0;
}
