#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x;
  cin >> x;
  return x;
}
const long long MOD = 1e9 + 7;
const long long mod = 1e9 + 7;
const long long m = 1e5 + 9;
long long n;
long long temp;
long long cnt;
void test_case() {
  long long n;
  cin >> n;
  long long arr[1000];
  for (long long i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  long long brr[1000];
  for (long long i = 1; i <= n; i++) {
    cin >> brr[i];
  }
  vector<pair<long long, long long>> ans;
  for (long long i = 1; i < n; i++) {
    if (arr[i] != brr[i]) {
      long long ind;
      for (long long j = i + 1; j <= n; j++) {
        if (brr[j] == arr[i]) {
          ind = j;
          break;
        }
      }
      for (long long j = ind - 1; j >= i; j--) {
        ans.push_back({j, j + 1});
        swap(brr[j], brr[j + 1]);
      }
    }
  }
  cout << ans.size() << "\n";
  for (auto it : ans) {
    cout << it.first << " " << it.second << "\n";
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  long long t = 1;
  while (t--) {
    test_case();
  }
}
