#include <bits/stdc++.h>
using namespace std;
long long gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(int a, int b) { return (a * b) / gcd(a, b); }
const double eps = 1e-8;
int main() {
  int t, n, m;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int arr1[n];
  for (int i = 0; i < n; i++) {
    cin >> arr1[i];
  }
  int arr2[1000000];
  int arr3[1000000];
  memset(arr2, 0, sizeof(arr2));
  memset(arr3, 0, sizeof(arr3));
  int a = 0, l = 0;
  for (int i = 0; i < n; i++) {
    int b = 0, c = 0;
    for (int j = i + 1; j < n; j++) {
      if (arr[i] == arr1[j]) {
        c = j;
        break;
      }
    }
    if (c != i) {
      for (int k = c; k > i; k--) {
        arr2[l] = k;
        arr3[l] = k + 1;
        l++;
        swap(arr1[k], arr1[k - 1]);
      }
    }
  }
  cout << l << endl;
  for (int i = 0; i < l; i++) {
    cout << arr2[i] << " " << arr3[i] << endl;
  }
  return 0;
}
