#include <bits/stdc++.h>
using namespace std;
set<long long> s;
set<long long>::iterator it;
vector<pair<int, int> > v;
long long a[1000], b[1000];
void func(int x, int y) {
  if (x == y) return;
  int temp = y - 1;
  while (1) {
    v.push_back(make_pair(temp, temp + 1));
    long long p = b[temp];
    b[temp] = b[temp + 1];
    b[temp + 1] = p;
    if (temp == x) return;
    temp--;
  }
}
int main() {
  int n, i, j;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  for (i = 1; i <= n; i++) {
    scanf("%lld", &b[i]);
  }
  int k;
  for (i = 1; i <= n; i++) {
    long long x = a[i];
    for (j = i; j <= n; j++) {
      if (x == b[j]) {
        func(i, j);
        break;
      }
    }
  }
  printf("%d\n", v.size());
  int m = v.size();
  for (i = 0; i < m; i++) printf("%d %d\n", v[i].first, v[i].second);
  return 0;
}
