#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
int n;
struct u {
  int num;
  int date;
  bool book;
} a[N], b[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].date;
    a[i].num = i;
    a[i].book = true;
  }
  for (int j = 1; j <= n; j++) {
    cin >> b[j].date;
    for (int i = 1; i <= n; i++) {
      if (a[i].date == b[j].date && a[i].book) {
        b[j].num = a[i].num;
        a[i].book = false;
        break;
      }
    }
  }
  int sum = 0;
  vector<int> u;
  vector<int> v;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < n; j++) {
      if (b[j].num > b[j + 1].num) {
        sum++;
        u.push_back(j);
        v.push_back(j + 1);
        swap(b[j], b[j + 1]);
      }
    }
  }
  cout << sum << endl;
  for (int i = 0; i < (int)u.size(); i++) {
    cout << u[i] << " " << v[i] << endl;
    ;
  }
  return 0;
}
