#include <bits/stdc++.h>
using namespace std;
void run() {
  long long n;
  cin >> n;
  long long a[n], b[n], done[n], start = 0;
  memset(done, 0, sizeof(done));
  ;
  for (long long i = 0; i < n; i++) cin >> a[i], a[i]--;
  for (long long i = 0; i < n; i++) cin >> b[i], b[i]--;
  for (long long i = 0; i < n; i++) {
    if (done[b[i]]) {
      cout << 0 << " ";
      continue;
    }
    long long count = 0;
    while (start < n && a[start] != b[i]) {
      done[a[start]] = 1;
      start++;
      count++;
    }
    done[a[start]] = 1;
    start++;
    count++;
    cout << count << " ";
  }
}
void setup() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cout << setprecision(20);
}
signed main() {
  setup();
  long long tests = 1;
  for (long long i = 1; i <= tests; i++) run();
  return 0;
}
