#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> a(n, 0);
  vector<long long int> b(n, 0);
  unordered_map<long long int, queue<long long int>> mp, mp1;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long int i = 0; i < n; i++) {
    cin >> b[i];
    mp[b[i]].push(i);
  }
  vector<pair<long long int, long long int>> v;
  for (long long int i = 0; i < n; i++) {
    long long int f = 0;
    for (long long int j = i; j < n; j++) {
      if (a[i] == b[j]) {
        f = j;
        break;
      }
    }
    for (long long int k = f; k > i; k--) {
      swap(b[k], b[k - 1]);
      v.push_back(make_pair(k, k + 1));
    }
  }
  cout << v.size() << endl;
  for (long long int i = 0; i < v.size(); i++) {
    cout << v[i].first << " " << v[i].second << endl;
  }
}
