#include <bits/stdc++.h>
using namespace std;
bool gone[1000000];
int n;
int ord[1000000], put[1000000];
int main() {
  scanf("%i", &n);
  for (int(a) = 0; (a) < (n); (a)++) scanf("%i", ord + a);
  for (int(a) = 0; (a) < (n); (a)++) scanf("%i", put + a);
  int i = 0;
  for (int(a) = 0; (a) < (n); (a)++) {
    int res = 0;
    if (gone[put[a]] || i >= n) {
      printf("%i ", res);
      continue;
    }
    while (ord[i] != put[a]) {
      gone[ord[i]] = true;
      i++;
      res++;
    }
    gone[ord[i]] = true;
    i++;
    res++;
    printf("%i ", res);
  }
  printf("\n");
  return 0;
}
