#include <bits/stdc++.h>
using namespace std;
int a[305], b[305];
int main() {
  int i, j, n;
  while (~scanf("%d", &n)) {
    vector<int> x;
    vector<int> y;
    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--;
      }
    }
    cout << x.size() << endl;
    for (i = 0; i < x.size(); i++) printf("%d %d\n", x[i], y[i]);
  }
  return 0;
}
