#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[200007] = {0}, b[200007] = {0}, c[200007] = {0}, mx, sum;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    c[a[i]] = i;
  }
  mx = 0;
  sum = 0;
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  for (int i = 1; i <= n; i++) {
    if (c[b[i]] > c[mx]) {
      cout << c[b[i]] - c[mx] << " ";
      mx = b[i];
    } else {
      cout << "0 ";
    }
  }
  return 0;
}
