#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long int> a, b;
  for (int i = 0; i < n; i++) {
    long int temp;
    cin >> temp;
    a.push_back(temp);
  }
  for (int i = 0; i < n; i++) {
    long int temp;
    cin >> temp;
    b.push_back(temp);
  }
  vector<int> c, d;
  for (int i = 0; i < n; i++) {
    if (b[i] != a[i]) {
      int j;
      for (j = i + 1; j < n; j++) {
        if (b[j] == a[i]) {
          break;
        }
      }
      int temp = b[j];
      for (int k = j; k > i; k--) {
        b[k] = b[k - 1];
        c.push_back(k + 1);
        d.push_back(k);
      }
      b[i] = temp;
    }
  }
  cout << c.size() << endl;
  for (int i = 0; i < c.size(); i++) {
    cout << d[i] << ' ' << c[i] << endl;
  }
}
