#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0;
  cin >> n;
  int a[n], b[n];
  vector<pair<int, int> > v;
  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++) {
    int j = i;
    while (b[j] != a[i]) j++;
    while (j > i) swap(b[j], b[j - 1]), v.emplace_back(j, j + 1), j--;
  }
  cout << v.size() << "\n";
  for (int i = 0; i < v.size(); i++) {
    cout << v[i].first << " " << v[i].second << "\n";
  }
  return 0;
}
