#include <bits/stdc++.h>
using namespace std;
int a[200010], b[200010];
int pos[200010];
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    pos[a[i]] = i;
  }
  for (int i = 1; i <= n; i++) cin >> b[i];
  int st = 0;
  for (int i = 1; i <= n; i++) {
    int id = pos[b[i]];
    cout << max(0, id - st) << ' ';
    st = max(st, id);
  }
}
