#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int c[n + 1];
  for (int i = 1; i <= n; i++) {
    int p;
    cin >> p;
    c[p] = i;
  }
  int took = 0;
  for (int i = 0; i < n; i++) {
    int b;
    cin >> b;
    if (took >= c[b]) {
      cout << "0 ";
    } else {
      cout << c[b] - took << " ";
      took = c[b];
    }
  }
  return 0;
}
