#include <bits/stdc++.h>
using namespace std;
int a[305], b[305];
struct node {
  int l, r;
};
node que[1000005];
int main() {
  int sp;
  int i, j, k;
  sp = 0;
  int num;
  num = 0;
  int n;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (j = 1; j <= n; j++) cin >> b[j];
  for (i = 1; i <= n; i++) {
    if (a[i] == b[i]) continue;
    for (j = i + 1; j <= n; j++) {
      if (b[j] == a[i]) break;
    }
    for (k = j; k > i; k--) {
      swap(b[k], b[k - 1]);
      que[sp].l = k - 1;
      que[sp++].r = k;
      num++;
    }
  }
  cout << num << endl;
  for (i = 0; i < sp; i++) cout << que[i].l << " " << que[i].r << endl;
  return 0;
}
