#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
bool out[N];
int a[N], pt, n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  pt = 1;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    if (out[x])
      printf("0 ");
    else {
      int cnt = 0;
      while (pt <= n && a[pt] != x) out[a[pt]] = 1, pt++, cnt++;
      if (a[pt] == x) out[a[pt]] = 1, pt++, cnt++;
      printf("%d ", cnt);
    }
  }
}
