#include <bits/stdc++.h>
const long long LINF = 1e18;
const int INF = 1e9;
const int M = 1e9 + 7;
const double EPS = 1.0e-9;
const double PI = acos(-1.0);
using namespace std;
int a[200100];
bool used[200100];
int n;
int main() {
  std::ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int pos = 0;
  for (int i = 0; i < n; i++) {
    int b;
    cin >> b;
    int ans = 0;
    if (used[b]) {
      cout << "0 ";
      continue;
    }
    while (a[pos] != b) {
      used[a[pos]] = 1;
      ans++;
      pos++;
    }
    pos++;
    used[b] = 1;
    cout << ans + 1 << " ";
  }
  return 0;
}
