#include <bits/stdc++.h>
using namespace std;
const int INF = 305;
int n, a[INF], b[INF], fx[INF * INF * 5], fy[INF * INF * 5], tot;
bool vis[INF];
signed main() {
  scanf("%d", &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++) {
    int j = 1;
    for (j = i; j <= n; j++)
      if (b[j] == a[i]) break;
    if (i == j) continue;
    if (i < j)
      for (; j > i; j--) fx[++tot] = j - 1, fy[tot] = j, swap(b[j], b[j - 1]);
    if (i > j)
      for (; j < i; j++) fx[++tot] = j + 1, fy[tot] = j, swap(b[j], b[j + 1]);
  }
  cout << tot << "\n";
  for (int i = 1; i <= tot; i++) cout << fx[i] << " " << fy[i] << "\n";
  return 0;
}
