#include <bits/stdc++.h>
using namespace std;
int in[2 * 100010], s[2 * 100010];
int n;
int main() {
  scanf("%d", &n);
  memset(in, 0, sizeof(in));
  memset(s, 0, sizeof(s));
  for (int i = 0; i < n; i++) {
    int xx;
    scanf("%d", &xx);
    s[i] = xx;
    in[xx] = i + 1;
  }
  int t = 0;
  for (int i = 0; i < n; i++) {
    int x, j;
    scanf("%d", &x);
    if (in[x])
      for (j = t; j < n && s[j] != x; j++) in[s[j]] = 0;
    else {
      printf("0 ");
      continue;
    }
    printf("%d ", j - t + 1);
    t = j + 1;
  }
  return 0;
}
