#include <bits/stdc++.h>
using namespace std;
long n;
long a[200001], b[200001];
long f[200001];
queue<long> q;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (long i = 1; i <= n; i++) {
    cin >> a[i];
    f[a[i]] = 1;
    q.push(a[i]);
  }
  for (long i = 1; i <= n; i++) {
    cin >> b[i];
    if (f[b[i]] == 1) {
      long res = 1;
      f[b[i]] = 0;
      while (!q.empty() && q.front() != b[i]) {
        res++;
        f[q.front()] = 0;
        q.pop();
      }
      q.pop();
      cout << res << " ";
    } else
      cout << 0 << " ";
  }
  return 0;
}
