#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n), b(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &b[i]);
  }
  set<int> used;
  int i = 0, j = 0;
  for (; i < n && j < n; ++i) {
    if (used.count(b[i]) != 0) {
      printf("0 ");
    } else {
      int count = 0;
      while (a[j] != b[i]) {
        used.insert(a[j]);
        count++;
        ++j;
      }
      j++;
      count++;
      printf("%d ", count);
    }
  }
  while (i < n) {
    printf("0 ");
    ++i;
  }
  return 0;
}
