#include <bits/stdc++.h>
using namespace std;
struct Step {
  int x, y;
} step[1000005];
int a[305];
int b[305];
int sum = 0;
;
int n;
void swap(int &a, int &b) {
  a ^= b;
  b ^= a;
  a ^= b;
}
int main() {
  while (1 == scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
    for (int i = 1; i <= n; i++)
      for (int j = n; j >= 1; j--) {
        if (a[i] == b[j]) {
          for (int k = j; k > i; k--) {
            swap(b[k - 1], b[k]);
            sum++;
            step[sum].x = k - 1;
            step[sum].y = k;
          }
          break;
        }
      }
    printf("%d\n", sum);
    if (sum != 0) {
      for (int i = 1; i <= sum; i++) {
        printf("%d ", step[i].x);
        printf("%d\n", step[i].y);
      }
    }
    sum = 0;
    memset(step, 0, sizeof(step));
  }
  return 0;
}
