#include <bits/stdc++.h>
using namespace std;
const int N = 305;
int n, a[N], b[N];
vector<pair<int, int> > ans;
int main() {
  cin >> n;
  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]) {
      for (int j = i + 1; j <= n; j++) {
        if (a[i] == b[j]) {
          for (int k = j - 1; k >= i; k--) {
            swap(b[k], b[k + 1]);
            ans.push_back(make_pair(k, k + 1));
          }
          break;
        }
      }
    }
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << "\n";
  }
}
