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