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