#include <bits/stdc++.h>
using namespace std;
int n, a[300], b[300];
bool s[300];
vector<pair<int, int> > ans;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) cin >> b[i];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j && a[i] == b[j]) {
        s[i] = 1;
        break;
      }
      if (a[i] == b[j] && !s[j]) {
        if (j > i) {
          for (int l = j; l > i; --l) {
            ans.push_back({l, l + 1});
            swap(b[l], b[l - 1]);
          }
        } else {
          for (int l = j; l < i; ++l) {
            ans.push_back({l + 1, l + 2});
            swap(b[l], b[l + 1]);
          }
        }
        s[i] = 1;
        break;
      }
    }
  }
  cout << ans.size() << endl;
  for (pair<int, int> x : ans) cout << x.first << " " << x.second << endl;
}
