#include <bits/stdc++.h>
int N, used[200023], a[200023], b[200023];
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  int k = 0;
  for (int i = 0; i < N; i++) {
    scanf("%d", &b[i]);
    if (used[b[i]]) {
      printf("0 ");
      continue;
    }
    int ans = 0;
    while (a[k] != b[i]) {
      used[a[k]] = 1;
      ans++;
      k++;
    }
    used[a[k]] = 1;
    k++;
    ans++;
    printf("%d ", ans);
  }
  return 0;
}
