#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long arr[n], test[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> test[i];
  }
  int c = 0;
  vector<int> v1, v2;
  for (int i = 0; i < n; i++) {
    long long a = arr[i];
    long long x = test[i];
    if (a == x) {
      continue;
    }
    test[i] = a;
    int j = i + 1;
    while (j < n) {
      long long tmp = test[j];
      test[j] = x;
      x = tmp;
      if (x == a) {
        break;
      }
      j++;
    }
    int p = i + 1;
    int q = j + 1;
    v1.push_back(p);
    v2.push_back(q);
    c += q - p;
  }
  cout << c << endl;
  for (int i = 0; i < v1.size(); i++) {
    int p = v1[i];
    int q = v2[i];
    while (q > p) {
      cout << q - 1 << " " << q << endl;
      q--;
    }
  }
}
