#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long>> ans;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[n], b[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) cin >> b[i];
  for (long long i = 0; i < n; i++) {
    if (a[i] == b[i]) continue;
    for (long long j = n - 1; j > i; j--) {
      if (b[j] == a[i]) {
        swap(b[j], b[j - 1]);
        ans.push_back({j, j + 1});
      }
    }
  }
  cout << ans.size() << "\n";
  for (long long i = 0; i < ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second << "\n";
}
