#include <bits/stdc++.h>
using namespace std;
int n;
int v[200100], a[200100], b;
int cur;
int main() {
  while (~scanf("%d", &n)) {
    memset(v, -1, sizeof(v));
    cur = -1;
    for (int i = 0; i < n; i++) {
      scanf("%d", a + i);
      v[a[i]] = i;
    }
    for (int i = 0; i < n; i++) {
      scanf("%d", &b);
      if (v[b] == -1) {
        cout << 0;
      } else {
        cout << v[b] - cur;
        while (cur < v[b]) v[a[++cur]] = -1;
      }
      if (i == n - 1)
        cout << endl;
      else
        cout << " ";
    }
  }
  return 0;
}
