#include <bits/stdc++.h>
int main() {
  int n;
  std::vector<int> A;
  std::vector<int> B;
  std::vector<int> actions;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    int t;
    std::cin >> t;
    A.push_back(t);
  }
  for (int i = 0; i < n; i++) {
    int t;
    std::cin >> t;
    B.push_back(t);
  }
  for (int i = 0; i < A.size(); i++) {
    if (B[i] == A[i]) continue;
    int j = (std::find(B.begin() + i, B.end(), A[i]) - B.begin());
    while (j != i) {
      int t = B[j];
      B[j] = B[j - 1];
      B[j - 1] = B[j];
      j--;
      actions.push_back(j);
    }
  }
  std::cout << actions.size() << "\n";
  for (int i = 0; i < actions.size(); i++) {
    int j = actions[i] + 1;
    std::cout << j << ' ' << j + 1 << '\n';
  }
}
