#includeusing namespace std;const int maxn = 2*100000 + 5;int n,s[maxn],t[maxn],vis[maxn],res[maxn];int main(){ // freopen("data.in","r",stdin); // freopen("data.out","w",stdout); scanf("%d",&n); for(int i = 0; i < n; i++) scanf("%d",&s[i]); for(int i = 0; i < n; i++) scanf("%d",&t[i]); int j = 0; for(int i = 0; i < n; i++){ int cnt = 1; if(vis[t[i]]) cnt = 0; else{ while(s[j] != t[i]){ vis[s[j]] = 1; cnt++; j++; } j++; } res[i] = cnt; } for(int i = 0; i < n-1; i++) printf("%d ",res[i]); printf("%d\n",res[n-1]); return 0;}