#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[305], b[305];
  vector<pair<int, int> > v;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < n; i++) {
    int k = a[i];
    int j;
    for (j = i;; j++)
      if (b[j] == k) break;
    for (int l = j - 1; l >= i; l--)
      v.push_back({l + 1, l + 2}), swap(b[l], b[l + 1]);
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) {
    cout << v[i].first << " " << v[i].second << endl;
  }
}
