#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, a[200001], d = 0, x, t = 0, c;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &k);
    a[k] = i;
  }
  while (n--) {
    scanf("%d", &x);
    if (a[x] > d) {
      d = a[x];
      a[x] = a[x] - t;
      cout << a[x] << " ";
      t = d;
    } else {
      a[x] = 0;
      cout << a[x] << " ";
    }
  }
  cout << endl;
  return 0;
}
