#include <bits/stdc++.h>
using namespace std;
const long double epsilon = 1e-9;
int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(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> > moves;
  for (int i = 0; i < n; i++) {
    if (b[i] != a[i]) {
      for (int j = i + 1; j < n; j++) {
        if (b[j] == a[i]) {
          for (int k = j; k > i; k--) {
            moves.push_back(make_pair(k - 1, k));
            swap(b[k], b[k - 1]);
          }
          break;
        }
      }
    }
  }
  cout << moves.size() << endl;
  for (int i = 0; i < moves.size(); i++)
    cout << moves[i].first + 1 << " " << moves[i].second + 1 << endl;
  return 0;
}
