#include <bits/stdc++.h>
using namespace std;
int n, temp, x;
map<int, int> mp;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> x, mp[x] = i;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    if (mp[x] > temp)
      cout << mp[x] - temp << " ", temp = mp[x];
    else
      cout << 0 << " ";
  }
  return 0;
}
