#include <bits/stdc++.h>
using namespace std;
int a[200002], b[200002];
int vis[200002];
int main() {
  int n, i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int t = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &b[i]);
    if (vis[b[i]]) {
      cout << 0;
      if (i != n - 1) cout << ' ';
    } else {
      for (j = t; j < n; j++) {
        if (a[j] == b[i]) {
          cout << j - t + 1;
          if (i != n - 1) cout << ' ';
          t = j + 1;
          vis[a[j]] = 1;
          break;
        }
        vis[a[j]] = 1;
      }
    }
  }
  cout << endl;
  return 0;
}
