#include <bits/stdc++.h>
const int Max = 100000;
using namespace std;
int temp1[Max];
int temp2[Max];
int main() {
  int a[301];
  int b[301];
  int n;
  while (cin >> n) {
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) cin >> b[i];
    int ans = 0;
    for (int i = 1; i <= n; i++)
      for (int j = i; j <= n; j++)
        if (b[j] == a[i]) {
          int mmp = j;
          while (mmp != i) {
            int temp = b[mmp];
            b[mmp] = b[mmp - 1];
            b[mmp - 1] = temp;
            temp1[ans] = mmp - 1;
            temp2[ans] = mmp;
            ans++;
            mmp--;
          }
          break;
        }
    cout << ans << endl;
    for (int i = 0; i < ans; i++) {
      cout << temp1[i] << " " << temp2[i] << endl;
    }
  }
  return 0;
}
