#include <bits/stdc++.h>
using namespace std;
void task1();
void task2();
int main() {
  task2();
  return 0;
}
void task1() {
  long long n, r, c;
  cin >> n >> r >> c;
  if (r + c > n + 1)
    printf("Black");
  else
    printf("White");
}
void task2() {
  int i, j = 0, n, s, a[200001], b, t[200001];
  for (scanf("%d", &n); j++ < n; t[j]++) scanf("%d", a + j);
  for (i = 0, j = 1; i++ < n;) {
    scanf("%d", &b);
    for (s = 0; t[b]; j++) t[a[j]] = 0, s++;
    printf("%d ", s);
  }
}
