#include <bits/stdc++.h>
using namespace std;
int n, a[305], b[305], np, px[2000000], py[2000000];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < n; i++) scanf("%d", b + i);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int j;
    for (j = i; j < n; j++)
      if (b[j] == a[i]) break;
    if (j == i) continue;
    for (int k = j; k >= i + 1; k--) {
      px[cnt] = k - 1;
      py[cnt] = k;
      swap(b[k], b[k - 1]);
      cnt++;
    }
  }
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++) {
    printf("%d %d\n", px[i] + 1, py[i] + 1);
  }
}
