#include <bits/stdc++.h>
using namespace std;
int a[300], b[300], c[300];
void swap(int i) {
  int temp = b[i];
  b[i] = b[i + 1];
  b[i + 1] = temp;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) {
    scanf("%d", &b[i]);
    c[i] = b[i];
  }
  int counter = 0;
  for (int i = 0; i < n; i++) {
    int k;
    for (int j = i; j < n; j++) {
      if (b[j] == a[i]) {
        k = j;
        break;
      }
    }
    if (i == k) continue;
    for (int j = k - 1; j >= i; j--) {
      swap(j);
      counter++;
    }
  }
  cout << counter << endl;
  for (int i = 0; i < n; i++) {
    b[i] = c[i];
  }
  for (int i = 0; i < n; i++) {
    int k;
    for (int j = i; j < n; j++) {
      if (b[j] == a[i]) {
        k = j;
        break;
      }
    }
    if (i == k) continue;
    for (int j = k - 1; j >= i; j--) {
      printf("%d %d\n", j + 1, j + 2);
      swap(j);
    }
  }
  return 0;
}
