#include <bits/stdc++.h>
using namespace std;
bool ase[200138];
int idx[200138];
int main() {
  int i, j, k;
  int n, m;
  int cnt;
  scanf("%d", &n);
  vector<int> a, b;
  memset(ase, 0, sizeof(ase));
  a.resize(n), b.resize(n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]), ase[a[i]] = true, idx[a[i]] = i;
  for (i = 0; i < n; i++) scanf("%d", &b[i]);
  for (i = 0; i < n; i++) {
    if (!ase[b[i]])
      printf("%s", "0 ");
    else {
      k = idx[b[i]];
      cnt = 0;
      while (k >= 0) {
        cnt++;
        ase[a[k]] = false;
        k--;
        if (k >= 0 && !ase[a[k]]) break;
      }
      printf("%d", cnt);
      printf("%s", " ");
    }
  }
  return 0;
}
