#include <bits/stdc++.h>
using namespace std;
vector<long int> a, b;
int pos(int k, int x) {
  for (int i = k; i < b.size(); i++)
    if (b[i] == x) return i;
}
int main() {
  int n;
  cin >> n;
  a.resize(n);
  b.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  vector<pair<int, int> > ans;
  long int co = 0;
  for (int i = 0; i < n; i++)
    if (a[i] != b[i]) {
      int x = pos(i, a[i]);
      for (int j = x; j > i; j--) {
        swap(b[j - 1], b[j]);
        co++;
        ans.push_back(make_pair(j, j + 1));
      }
    }
  cout << co << endl;
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second << endl;
  return 0;
}
