#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<pair<int, bool> > a(N);
  vector<pair<int, int> > b(N);
  for (int i = 0; i < N; ++i) {
    scanf("%d", &a[i].first);
    a[i].second = false;
  }
  int j;
  for (int i = 0; i < N; ++i) {
    scanf("%d", &b[i].first);
    for (j = 0; j < N; ++j) {
      if (b[i].first == a[j].first && !a[j].second) {
        a[j].second = true;
        b[i].second = j;
        break;
      }
    }
  }
  vector<int> res;
  for (int i = 0; i < N - 1; ++i) {
    for (j = 0; j < N - 1; ++j) {
      if (b[j].second > b[j + 1].second) {
        swap(b[j], b[j + 1]);
        res.push_back(j + 1);
      }
    }
  }
  cout << res.size() << endl;
  for (int i = 0; i < res.size(); ++i) {
    printf("%d %d\n", res[i], res[i] + 1);
  }
  return 0;
}
