#include <bits/stdc++.h>
using namespace std;
int a[306], b[306], A[306];
bool seen[306];
vector<pair<int, int> > v;
int p[306];
vector<pair<int, int> > ans;
int bubble_sort(int l) {
  int cont = 0, i, j, tmp;
  for (i = l - 1; i > 0; --i) {
    for (j = 1; j <= i; ++j) {
      if (A[j - 1] > A[j]) {
        std::swap(A[j - 1], A[j]);
        ans.push_back(make_pair(j, j + 1));
        cont++;
      }
    }
  }
  return cont;
}
int main() {
  int n, i, j;
  scanf("%d", &n);
  for (i = 0; i < n && scanf("%d", &a[i]); ++i) {
    v.push_back(make_pair(a[i], i));
    p[i] = a[i];
  }
  memset(seen, 0, sizeof(seen));
  for (i = 0; i < n && scanf("%d", &b[i]); ++i) {
    for (j = 0; j < n; ++j) {
      if (v[j].first == b[i] && !seen[v[j].second]) {
        A[i] = v[j].second;
        seen[v[j].second] = 1;
        break;
      }
    }
  }
  printf("%d\n", bubble_sort(n));
  for (i = 0; i < ans.size(); ++i)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
