#include <bits/stdc++.h>
using namespace std;
const int MAXN = 305;
queue<pair<int, int> > q;
int t[MAXN], cel[MAXN];
int main() {
  int n, a, b, c, d, e;
  scanf("%d", &n);
  for (a = 1; a <= n; a++) scanf("%d", &cel[a]);
  for (a = 1; a <= n; a++) scanf("%d", &t[a]);
  for (a = 1; a < n; a++) {
    for (b = a; t[b] != cel[a]; b++)
      ;
    for (b--; b >= a; b--) {
      q.push(make_pair(b, b + 1));
      swap(t[b], t[b + 1]);
    }
  }
  printf("%d\n", q.size());
  while (!q.empty()) {
    pair<int, int> p = q.front();
    q.pop();
    printf("%d %d\n", p.first, p.second);
  }
  return 0;
}
