#include <bits/stdc++.h>
using namespace std;
int a[305];
int b[305];
int c[305];
map<int, vector<int> > m;
int ans[10000005][2];
int main() {
  int i, j, n, up;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    m[a[i]].push_back(i);
  }
  for (i = 0; i < n; i++) {
    scanf("%d", &b[i]);
    c[i] = m[b[i]][m[b[i]].size() - 1];
    m[b[i]].pop_back();
  }
  up = 0;
  for (i = 0; i < n; i++) {
    for (j = n - 1; j > i; j--) {
      if (c[j] < c[j - 1]) {
        swap(c[j], c[j - 1]);
        ans[up][0] = j - 1;
        ans[up++][1] = j;
      }
    }
  }
  printf("%d\n", up);
  for (i = 0; i < up; i++) {
    printf("%d %d\n", ans[i][0] + 1, ans[i][1] + 1);
  }
  return 0;
}
