#include <bits/stdc++.h>
using namespace std;
int a[1001000], b[1001000];
int n;
int x[1001000], y[1001000];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", b + i);
  }
  int k = 0;
  for (int i = 1; i <= n; ++i) {
    int flag = 0;
    for (int j = n; j > i; --j) {
      if (a[i] == b[j]) {
        x[++k] = j - 1;
        y[k] = j;
        swap(b[j], b[j - 1]);
      }
    }
  }
  printf("%d\n", k);
  for (int i = 1; i <= k; ++i) {
    printf("%d %d\n", x[i], y[i]);
  }
  return 0;
}
