#include <bits/stdc++.h>
using namespace std;
int a[1000010] = {0}, b[1000010] = {0}, c[10010], d[10010], top = 0;
int main() {
  int i, n, j, k, m = 0, te;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &c[i]);
  for (i = 1; i <= n; i++) scanf("%d", &d[i]);
  for (i = 1; i <= n; i++) {
    m = 0;
    if (c[i] != d[i]) {
      for (m = n; m > 0; m--)
        if (d[m] == c[i]) break;
      for (j = m; j >= i + 1; j--)
        a[top] = j - 1, b[top++] = j, te = d[j], d[j] = d[j - 1], d[j - 1] = te;
    }
  }
  printf("%d\n", top);
  for (i = 0; top && i < top; i++) printf("%d %d\n", a[i], b[i]);
}
