#include <bits/stdc++.h>
using namespace std;
const long long M = 1e6 + 10, MOD = 1e9 + 7;
vector<long long> v, v1;
vector<pair<int, int> > pi;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, l = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    v.push_back(a);
  }
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    v1.push_back(a);
  }
  for (int i = 0; i < n; i++) {
    if (v[i] != v1[i]) {
      int index = 0;
      for (int j = i + 1; j < n; j++)
        if (v[i] == v1[j]) {
          index = j;
          break;
        }
      for (int j = index; j > i; j--) {
        swap(v1[j], v1[j - 1]);
        l++;
        pi.push_back({j, j + 1});
      }
    }
  }
  cout << l << "\n";
  for (int i = 0; i < l; i++)
    cout << pi[i].first << " " << pi[i].second << "\n";
  return 0;
}
