#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  int b[n];
  int i = 1;
  i = 1;
  int e;
  while (i <= n) {
    cin >> e;
    a[e] = i;
    i++;
  }
  cin >> b[0];
  int max = a[b[0]];
  cout << max << " ";
  i = 2;
  while (i <= n) {
    cin >> b[i];
    if (a[b[i]] < max)
      cout << 0 << " ";
    else {
      cout << a[b[i]] - max << " ";
      max = a[b[i]];
    }
    i++;
  }
}
