#include <bits/stdc++.h>
int a[305], b[305], S[1000005];
int main() {
  int n, i, j, k, top;
  while (~scanf("%d", &n)) {
    top = 0;
    for (i = 1; i <= n; i++) scanf("%d", &a[i]);
    for (i = 1; i <= n; i++) scanf("%d", &b[i]);
    for (i = n; i > 1; i--) {
      if (a[i] == b[i]) continue;
      for (j = i - 1; b[j] != a[i]; j--)
        ;
      for (k = j; k < i; k++) {
        b[k] = b[k + 1];
        S[top++] = k;
      }
      b[k] = a[i];
    }
    printf("%d\n", top);
    for (i = 0; i < top; i++) printf("%d %d\n", S[i], S[i] + 1);
  }
  return 0;
}
