#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 1e6 + 500;
const long long int mod = 998244353;
int a[maxn], b[maxn];
int t[maxn];
int main() {
  int top = 0;
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    t[a[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
    if (i != 1) putchar(' ');
    if (t[b[i]] > top)
      printf("%d", t[b[i]] - top);
    else
      putchar('0');
    top = max(top, t[b[i]]);
  }
  putchar('\n');
}
