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