#include <bits/stdc++.h>
using namespace std;
void count() {}
int ans[1000001], h = 0;
int main() {
  count();
  int n;
  cin >> n;
  int a[301], b[301];
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; ++i) {
    cin >> b[i];
  }
  for (int i = 1; i <= n; ++i) {
    if (a[i] != b[i]) {
      int id;
      for (int j = i + 1; j <= n; ++j) {
        if (b[j] == a[i]) {
          id = j;
          break;
        }
      }
      for (int j = id; j > i; --j) {
        ans[h++] = j;
        swap(b[j], b[j - 1]);
      }
    }
  }
  cout << h << endl;
  for (int i = 0; i < h; ++i) {
    cout << ans[i] - 1 << " " << ans[i] << endl;
  }
  return 0;
}
