#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
using tp = tuple<ll, ll, ll>;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll)1e9 + 7;
using ld = long double;
static const ld pi = 3.141592653589793L;
using Array = vector<ll>;
using Matrix = vector<Array>;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
struct Edge {
  int to;
  ll cap;
  Edge(int _to, ll _cap) : to(_to), cap(_cap) {}
};
void add_edge(vector<vector<Edge>> &G, int from, int to, ll cap, bool revFlag,
              ll revCap) {
  G[from].push_back(Edge(to, cap));
  if (revFlag) G[to].push_back(Edge(from, revCap));
}
void solve() {
  ll n;
  cin >> n;
  vec<ll> a(n), b(n);
  for (ll i = (ll)(0); i < (ll)(n); ++i) cin >> a[i];
  for (ll i = (ll)(0); i < (ll)(n); ++i) cin >> b[i];
  vec<ll> pos(n + 1, -1);
  for (ll i = (ll)(0); i < (ll)(n); ++i) {
    pos[a[i]] = i;
  }
  ll pre = -1;
  for (ll i = (ll)(0); i < (ll)(n); ++i) {
    ll now = pos[b[i]];
    if (pre < now) {
      cout << now - pre << " ";
      pre = now;
    } else {
      cout << 0 << " ";
    }
  }
  cout << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
