#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[200010], s[200010], b[200010];
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    s[a[i]] = i;
  }
  int j = 0;
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
    int ans = s[b[i]] - j;
    if (ans < 0)
      ans = 0;
    else
      j = s[b[i]];
    cout << ans << " ";
  }
}
