#include <bits/stdc++.h>
using namespace std;
int a[305], b[305];
int m, u[305 * 305], v[305 * 305];
int main() {
  int n;
  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]);
  for (int i = 0; i < n; i++) {
    if (b[i] == a[i]) continue;
    int j;
    for (j = i; j < n; j++)
      if (b[j] == a[i]) break;
    for (; j > i; j--) {
      u[m] = j - 1;
      v[m++] = j;
      swap(b[j], b[j - 1]);
    }
  }
  printf("%d\n", m);
  for (int i = 0; i < m; i++) printf("%d %d\n", u[i] + 1, v[i] + 1);
  return 0;
}
