#include <bits/stdc++.h>
using namespace std;
set<int> q;
int n, a[230000], b[230000], ans[230000];
signed main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  int at = 1;
  for (int i = 1; i <= n; i++) {
    int now = 0;
    if (q.find(b[i]) != q.end()) {
      ans[i] = 0;
      continue;
    }
    while (a[at - 1] != b[i]) {
      now++;
      q.insert(a[at]);
      at++;
    }
    ans[i] = now;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
