#include <bits/stdc++.h>
using namespace std;
int i, j, k, q, timer, x, y, n, m, cnt, even, flag, dlfjl, dskgj, dkfj, dskfj,
    boom, r, c, z;
int a[200500], used[200500];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    used[a[i]] = i + 1;
  }
  int mx = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    x = used[x];
    int ans = max(x - mx, 0);
    mx = max(mx, x);
    printf("%d ", ans);
  }
  return 0;
}
