#include <bits/stdc++.h>
using namespace std;
int has1[1000005], has2[1000005];
int main() {
  int x[305], y[305], a, b, c, d, e, i, j, k;
  bool ok;
  b = 0;
  cin >> a;
  for (i = 1; i <= a; i++) cin >> x[i];
  for (j = 1; j <= a; j++) cin >> y[j];
  for (i = a; i >= 1; i--) {
    for (j = 1; j <= i - 1; j++) {
      if (y[j] == x[i]) {
        for (k = j; k <= i - 1; k++) {
          swap(y[k], y[k + 1]);
          b++;
          has1[b] = k;
          has2[b] = k + 1;
        }
        break;
      }
    }
  }
  cout << b << "\n";
  for (i = 1; i <= b; i++) {
    cout << has1[i] << " " << has2[i] << "\n";
  }
}
