#include <bits/stdc++.h>
using namespace std;
const int inf = (1 << 30);
vector<pair<int, int> > ans;
int a[400], b[400], i, j, x, n, k, p;
bool w[400];
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) cin >> b[i];
  for (i = 1; i <= n; i++) {
    for (j = i; j <= n; j++)
      if (a[i] == b[j]) break;
    for (p = j - 1; p >= i; p--) {
      swap(b[p], b[p + 1]);
      ans.push_back(make_pair(p, p + 1));
    }
  }
  printf("%d\n", (int)(ans).size());
  for (i = 0; i < (int)(ans).size(); i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
