#include <bits/stdc++.h>
using namespace std;
vector<long long> v1, v2;
long long nom = 0;
vector<long long> fun(long long x) {
  long long f = 0;
  long long i;
  vector<long long> vec;
  for (i = 0; i < v2.size(); i++) {
    if (f == 1)
      vec.push_back(v2[i]);
    else {
      if (v2[i] == x) {
        nom = i;
        f = 1;
      } else
        vec.push_back(v2[i]);
    }
  }
  return vec;
}
int main() {
  vector<pair<long long, long long> > otv;
  long long a, s = 0, d, i, j, k;
  cin >> a;
  for (i = 0; i < a; i++) {
    cin >> s;
    v1.push_back(s);
  }
  for (i = 0; i < a; i++) {
    cin >> s;
    v2.push_back(s);
  }
  for (i = 0; i < a; i++) {
    vector<long long> tt;
    tt = fun(v1[i]);
    v2 = tt;
    for (j = nom; j > 0; j--) {
      otv.push_back({j + 1 + i, j + i});
    }
  }
  cout << otv.size() << endl;
  for (i = 0; i < otv.size(); i++) {
    cout << otv[i].second << " " << otv[i].first << endl;
  }
}
