#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
} c[1010000];
int a[500], b[500];
int main() {
  int n, i, j, k, ans = 0, t;
  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++) {
    for (j = i; j <= n; j++) {
      if (b[j] == a[i]) break;
    }
    for (k = j; k > i; k--) {
      ans++;
      c[ans].x = k - 1;
      c[ans].y = k;
      t = b[k];
      b[k] = b[k - 1];
      b[k - 1] = t;
    }
  }
  printf("%d\n", ans);
  for (i = 1; i <= ans; i++) printf("%d %d\n", c[i].x, c[i].y);
  return 0;
}
