#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 10;
int a[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    a[x] = i;
  }
  int x = 0;
  for (int i = 0; i < n; i++) {
    int m;
    scanf("%d", &m);
    int t = a[m] - x;
    if (t < 0) {
      printf("0 ");
    } else {
      printf("%d ", t);
      x = a[m];
    }
  }
  return 0;
}
