#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k;
  int n, m, t;
  scanf("%d", &n);
  int a[n], b[n];
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  for (i = 0; i < n; i++) scanf("%d", &b[i]);
  vector<pair<int, int> > ans;
  for (i = 0; i < n - 1; i++) {
    k = -1;
    for (j = i; j < n; j++) {
      k = j;
      if (a[i] == b[j]) break;
    }
    while (k != i) {
      ans.push_back({k - 1, k});
      swap(b[k], b[k - 1]);
      k--;
    }
  }
  printf("%d", ans.size()), printf("\n");
  ;
  for (pair<int, int> e : ans)
    printf("%d %d", e.first + 1, e.second + 1), printf("\n");
  ;
  return 0;
}
