#include <bits/stdc++.h>
using namespace std;
int main() {
  int stack[200020];
  int n, i;
  int x;
  int max = 0;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> x;
    stack[x] = i;
  }
  for (i = 0; i < n; i++) {
    cin >> x;
    if (stack[x] >= max) {
      cout << stack[x] - max;
      max = stack[x];
    } else
      cout << 0;
    if (i != n - 1)
      cout << " ";
    else
      cout << "\n";
  }
  return 0;
}
