#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 7;
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f * x;
}
int n, a[200005], _x, s, _t;
bool v[200005];
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  _x = 1;
  for (int i = 1; i <= n; i++) {
    int s = 0;
    _t = read();
    if (v[_t]) {
      printf("0 ");
      continue;
    }
    while (a[_x] != _t) v[a[_x]]++, s++, _x++;
    s++;
    v[_t]++;
    _x++;
    printf("%d ", s);
  }
  return 0 * printf("\n");
}
