#include <bits/stdc++.h>
using namespace std;
void desperate_optimization(int precision) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.setf(ios::showpoint);
  cout.precision(precision);
}
const int N = 2e5;
int a[N + 5];
int b[N + 5];
int occ[N + 5];
void hora(int tc) {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  int l = 1;
  for (int i = 1; i <= n; i++) {
    if (occ[b[i]] == 1) {
      cout << 0 << " ";
      continue;
    }
    int ctr = 0;
    while (occ[b[i]] == 0) {
      ctr++;
      occ[a[l]] = 1;
      l++;
    }
    cout << ctr << " ";
  }
  cout << '\n';
}
int main() {
  desperate_optimization(10);
  int ntc = 1;
  for (int tc = 1; tc <= ntc; tc++) hora(tc);
  return 0;
}
