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