#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const double pi = 3.141592653589793238462;
const int nmax = 200000;
const int hash_base = 119;
const long long inf = 1e9;
int n, a[nmax], b[nmax];
vector<pair<int, int> > ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  for (int i = 1; i <= n; i++)
    if (a[i] != b[i]) {
      for (int j = i + 1; j <= n; j++)
        if (a[i] == b[j]) {
          for (int k = j; k > i; k--) {
            swap(b[k], b[k - 1]);
            ans.push_back(make_pair(k - 1, k));
          };
          break;
        };
    };
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
