#include <bits/stdc++.h>
using namespace std;
int n;
int as[310];
int bs[310];
vector<pair<int, int> > buf;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> as[i];
  for (int i = 0; i < n; ++i) cin >> bs[i];
  for (int i = 0; i < n; ++i) {
    int j = i;
    while (j < n && bs[j] != as[i]) ++j;
    if (i != j)
      for (int k = j; k > i; --k) {
        buf.push_back(make_pair(k, k + 1));
        swap(bs[k - 1], bs[k]);
      }
  }
  cout << buf.size() << endl;
  for (size_t i = 0; i < buf.size(); ++i)
    cout << buf[i].first << ' ' << buf[i].second << endl;
  return 0;
}
