#include <bits/stdc++.h>
using namespace std;
int n;
int a[10001];
int b[10001];
struct wgh {
  int x, y;
} ans1[1000001];
int ans;
int main() {
  int i, j, k;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
  }
  for (i = 1; i <= n; i++) {
    if (a[i] == b[i]) continue;
    for (j = i; j <= n; j++) {
      if (a[i] == b[j]) {
        while (j != i) {
          ans++;
          ans1[ans].x = j - 1;
          ans1[ans].y = j;
          swap(b[j], b[j - 1]);
          j--;
        }
        break;
      }
    }
  }
  printf("%d\n", ans);
  for (i = 1; i <= ans; i++) {
    printf("%d %d\n", ans1[i].x, ans1[i].y);
  }
  return 0;
}
