#include <bits/stdc++.h>
using namespace std;
int n, a[200009], b[200009], d[200009];
int re[200009];
void nhap() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i], d[a[i]] = i;
  for (int i = 1; i <= n; i++) cin >> b[i];
}
void solve() {
  int st = 0, pos = 1;
  for (int i = 1; i <= n; i++) {
    if (d[b[i]])
      cout << d[b[i]] - st << " ", st = d[b[i]];
    else
      cout << 0 << " ";
    for (int j = pos; j <= d[b[i]]; j++) d[a[j]] = 0;
    pos = st;
  }
}
int main() {
  nhap();
  solve();
  return 0;
}
