#include <bits/stdc++.h>
using namespace std;
long long i, j, a, b, t, n;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  long mp[200005];
  for (i = 1; i <= n; i++) {
    cin >> a;
    mp[a] = i;
  }
  for (i = 1; i <= n; i++) {
    cin >> b;
    if (t < mp[b]) {
      cout << mp[b] - t << " ";
      t = mp[b];
    } else {
      cout << "0 ";
    }
  }
}
