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