#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[200001], b, n, sum, j, k;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &j);
    a[j] = i;
  }
  sum = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b);
    if (a[b] < sum)
      cout << '0' << ' ';
    else {
      cout << a[b] - sum << ' ';
      sum = a[b];
    }
  }
  return 0;
}
