#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int arr[n];
  bool removed[n + 2];
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
    removed[arr[i]] = false;
  }
  int bi;
  int pos = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &bi);
    int tmp = 0;
    if (removed[bi] == false) {
      while (1) {
        tmp++;
        if (arr[pos] == bi) {
          removed[arr[pos]] = true;
          pos++;
          break;
        } else {
          removed[arr[pos]] = true;
          pos++;
        }
      }
    }
    printf("%d ", tmp);
  }
  printf("\n");
  return 0;
}
