#include <bits/stdc++.h>
using namespace std;
const int N = 3 * 100 + 50;
const int INF = 1e9;
int main() {
  int n, a[N], b[N];
  cin >> 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;
  for (int i = 0; i < n; i++) {
    if (a[i] == b[i]) continue;
    for (int j = i + 1; j < n; j++) {
      if (a[i] == b[j]) {
        for (int k = j; k > i; k--) {
          swap(b[k], b[k - 1]);
          ans.push_back(make_pair(k, k + 1));
        }
        break;
      }
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second << endl;
  return 0;
}
