#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int N = 2e5 + 10;
int a[N], b[N];
bool v[N];
int n;
int main() {
  scanf("%d", &n);
  for (auto i = 1, _end = n; i <= _end; ++i) scanf("%d", &a[i]);
  for (auto i = 1, _end = n; i <= _end; ++i) scanf("%d", &b[i]);
  for (auto i = 1, _end = n; i <= _end; ++i) v[i] = 1;
  int now = 1;
  for (auto i = 1, _end = n; i <= _end; ++i)
    if (v[b[i]]) {
      int cnt = 0;
      while (a[now] != b[i]) {
        v[a[now]] = 0;
        now++;
        cnt++;
      }
      v[a[now]]++;
      now++;
      cnt++;
      printf("%d ", cnt);
    } else
      printf("0 ");
}
