#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int MOD = 1e9 + 7;
int a[N], b[N];
int ans[N];
map<int, int> mp;
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), mp[a[i]] = i;
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    int pos = mp[b[i]];
    if (pos < mx)
      ans[i] = 0;
    else
      ans[i] = pos - mx;
    mx = max(mx, pos);
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
