#include <bits/stdc++.h>
using namespace std;
int n, a[400], b[400];
vector<pair<int, int> > ans;
int main() {
  ios_base::sync_with_stdio(false);
  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 q = a[i];
    int y = 0;
    for (int j = i; j <= n; j++) {
      if (b[j] == a[i]) {
        y = j;
        j = n + 1;
      }
    }
    for (int j = y; j > i; j--) {
      swap(b[j], b[j - 1]);
      ans.push_back(make_pair(j - 1, j));
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
