#include <bits/stdc++.h>
using namespace std;
const int maxn = 300 + 5;
vector<pair<int, int> > v;
int a[maxn], b[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] != b[i]) {
      for (int j = i + 1; j <= n; j++) {
        if (a[i] == b[j]) {
          for (int k = j - 1; k >= i; k--) {
            v.push_back({k, k + 1});
            swap(b[k], b[k + 1]);
          }
          break;
        }
      }
    }
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) {
    printf("%d %d\n", v[i].first, v[i].second);
  }
  return 0;
}
