#include <bits/stdc++.h>
using namespace std;
int a[200000], b[200000], res[200001];
bitset<200001> bs;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    bs[a[i]] = 1;
    res[a[i]] = i + 1;
  }
  for (int i = 0; i < n; i++) scanf("%d", &b[i]);
  int maxn = 0;
  for (int i = 0; i < n; i++) {
    if (bs[b[i]] && (res[b[i]] - maxn) >= 0)
      printf("%d ", res[b[i]] - maxn);
    else
      printf("0 ");
    maxn = max(maxn, res[b[i]]);
  }
  printf("\n");
  return 0;
}
