#include <bits/stdc++.h>
using namespace std;
int Int() {
  int x;
  scanf("%d", &x);
  return x;
}
long long Long() {
  long long x;
  scanf("%lld", &x);
  return x;
}
double Double() {
  double x;
  scanf("%lf", &x);
  return x;
}
float Float() {
  float x;
  scanf("%f", &x);
  return x;
}
const int N = 1e5 + 5;
int a[N];
int b[N];
int main() {
  int n = Int();
  vector<pair<int, int> > pi;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  for (int i = 1; i <= n; i++) {
    while (a[i] != b[i]) {
      int mid;
      for (int j = i; j <= n; j++) {
        if (b[j] == a[i]) {
          mid = j;
          break;
        }
      }
      swap(b[mid], b[mid - 1]);
      pi.push_back(make_pair(mid - 1, mid));
    }
  }
  cout << pi.size() << endl;
  for (auto j : pi) cout << j.first << " " << j.second << endl;
  return 0;
}
