#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k = 0, l, m = 0, n;
  cin >> n;
  int a[n + 1], b[n + 1], c[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    c[a[i]] = i;
  }
  for (i = 1; i <= n; i++) cin >> b[i];
  for (i = 1; i <= n; i++) {
    if (c[b[i]] > k) {
      cout << c[b[i]] - k << " ";
      k = c[b[i]];
    } else
      cout << 0 << " ";
  }
  cout << endl;
  return 0;
}
