#include <bits/stdc++.h>
double const PI = 4 * atan(1.0);
using namespace std;
int n, a[333], b[333], vitri;
vector<pair<int, int> > V;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < n; i++) {
    vitri = i;
    while (b[vitri] != a[i]) vitri++;
    for (; vitri > i; vitri--) {
      V.push_back(make_pair(vitri, vitri + 1));
      swap(b[vitri], b[vitri - 1]);
    }
  }
  printf("%d\n", V.size());
  for (int i = 0; i < V.size(); i++) printf("%d %d\n", V[i].first, V[i].second);
}
