#include <bits/stdc++.h>
using namespace std;
int main() {
  deque<int> vec;
  int arr[200005];
  int n, a;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    vec.push_back(a);
    arr[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    int j = 0, i1 = 0;
    if (arr[a - 1] == 1) {
      printf("0 ");
    } else if (vec.empty() != true) {
      int k = 0, f = 0;
      while (true) {
        arr[vec.front() - 1] = 1;
        if (vec.front() == a) {
          vec.pop_front();
          break;
        }
        vec.pop_front();
        k++;
      }
      printf("%d ", k + 1);
    } else
      printf("0 ");
  }
}
