#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
inline int read() {
  char ch = getchar();
  int x = 0;
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x;
}
int N;
bool vis[MAXN];
int a[MAXN];
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) a[i] = read();
  int p = 1;
  for (int i = 1; i <= N; i++) {
    int idx = read(), cnt = 0;
    if (!vis[idx]) {
      while (a[p] != idx) vis[a[p]] = true, ++cnt, ++p;
      vis[a[p]] = true, ++cnt, ++p;
    }
    printf("%d ", cnt);
  }
  return 0;
}
