#include <bits/stdc++.h>
using namespace std;
int n, a[200001], b, id[200001];
bool avail[200001];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    id[a[i]] = i;
    avail[i] = true;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b);
    if (avail[id[b]]) {
      int cnt = 0;
      for (int j = id[b]; j > 0 && avail[j]; j--) {
        cnt++;
        avail[j] = false;
      }
      printf("%d ", cnt);
    } else
      printf("0 ");
  }
}
