#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
int n, a[1010], b[1010];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  for (int i = 1; i <= n; i++) {
    int x = i;
    while (a[i] != b[x]) x++;
    while (x > i) {
      swap(b[x - 1], b[x]);
      ans.push_back(x - 1);
      x--;
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i] << " " << ans[i] + 1 << endl;
  return 0;
}
