#include <bits/stdc++.h>
using namespace std;
int n, a[310] = {}, b[310] = {};
vector<pair<int, int> > ans;
int main() {
  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++) {
    if (a[i] != b[i]) {
      for (int j = i + 1; j < n; j++) {
        if (a[i] == b[j]) {
          int d = j;
          while (d > i) {
            ans.push_back(make_pair(d, d + 1));
            swap(b[d], b[d - 1]);
            d--;
          }
          break;
        }
      }
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
