#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> a, b;
  int n, kol = 0;
  vector<pair<int, int>> pos;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    b.push_back(temp);
  }
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    a.push_back(temp);
  }
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i])
      for (int j = i + 1; j < n; j++)
        if (b[i] == a[j]) {
          for (int k = j; k > i; k--) {
            swap(a[k - 1], a[k]);
            kol++;
            pos.push_back(make_pair(k - 1, k));
          }
          break;
        }
  }
  cout << kol << endl;
  for (int i = 0; i < pos.size(); i++) {
    cout << pos[i].first + 1 << " " << pos[i].second + 1 << endl;
  }
  return 0;
}
