#include <bits/stdc++.h>
int main() {
  int n, a[10001], b[10001], c[100001][2], y;
  while (scanf("%d", &n) != EOF) {
    int t = 1, i, j, num = 0;
    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++) {
      for (j = n; a[i] != b[j] && j > 0; j--)
        ;
      if (i == j) {
        continue;
      } else {
        for (; j > i; j--) {
          c[t][0] = j - 1;
          c[t++][1] = j;
          num++;
          y = b[j];
          b[j] = b[j - 1];
          b[j - 1] = y;
        }
      }
    }
    printf("%d\n", num);
    if (num != 0) {
      for (i = 1; i <= num; i++) {
        printf("%d %d\n", c[i][0], c[i][1]);
      }
    }
  }
  return 0;
}
