#include <bits/stdc++.h>
using namespace std;
int n, a[200001], b[200001], d[200001], cnt, res;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    d[a[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
    if (res < d[b[i]]) {
      cout << d[b[i]] - res << " ";
      res = d[b[i]];
    } else {
      cout << 0 << " ";
    }
  }
  return 0;
}
