#include <bits/stdc++.h>
const int N = 2e5 + 50;
int zn[N], h = 1, n;
int vis[N], x, now;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &zn[i]);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    if (vis[x]) {
      printf("0 ");
      continue;
    }
    now = h;
    for (; h <= n; h++)
      if (zn[h] == x)
        break;
      else
        vis[zn[h]] = 1;
    h++;
    vis[x] = 1;
    printf("%d ", h - now);
  }
}
