#include <bits/stdc++.h>
using namespace std;
const int MAXn = 300 + 10;
int a[MAXn], b[MAXn];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int j = 0; j < n; j++) cin >> b[j];
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++)
    for (int j = i; j < n; j++)
      if (b[j] == a[i]) {
        for (int k = j; k > i; k--) {
          swap(b[k], b[k - 1]);
          v.push_back(pair<int, int>(k, k - 1));
        }
        break;
      }
  cout << v.size() << endl;
  for (int i = 0; i < (int)v.size(); i++)
    cout << v[i].second + 1 << " " << v[i].first + 1 << "\n";
  {
    int _;
    cin >> _;
  }
  return 0;
}
