#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;
const ll inf = (1e18);
const ll mod = 1000000007;
ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
ll LCM(ll c, ll d) { return c / GCD(c, d) * d; }
struct __INIT {
  __INIT() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
  }
} __init;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  V<ll> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  V<bool> used(n, false);
  V<int> ans(n, 0);
  int id = 0;
  for (int i = 0; i < n; i++) {
    if (used[b[i] - 1]) continue;
    bool ok = false;
    while (id < n && !ok) {
      ans[i]++;
      if (a[id] == b[i]) ok = true;
      used[a[id++] - 1] = true;
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " \n"[i == n - 1];
}
