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