#include <bits/stdc++.h>
using namespace std;
long long int a[100005];
long long int b[100005];
vector<int> moves;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < n; i++) {
    int j = i;
    for (; j < n; j++) {
      if (a[i] == b[j]) {
        break;
      }
    }
    for (int k = j; k > i; k--) {
      moves.push_back(k);
      swap(b[k], b[k - 1]);
    }
  }
  cout << moves.size() << endl;
  for (int i = 0; i < moves.size(); i++) {
    cout << moves[i] << " " << moves[i] + 1 << endl;
  }
  cout << endl;
}
