#include <bits/stdc++.h>
using namespace std;
bool sortin(const pair<long long int, long long int> &e,
            const pair<long long int, long long int> &f) {
  return (e.first < f.first);
}
bool POT(long long int x) { return x && (!(x & (x - 1))); }
long long int a, b, c, i, j, k, l, m, n, p, q, r, x, y, z, ts, mn = 10e17,
                                                               mod = 10e8 + 7;
long long int ar[300002], br[300002], xr[300002];
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  };
  cin >> n;
  for (long long int i = 1; i <= n; i++) cin >> p, ar[p] = i;
  for (long long int j = 1; j <= n; j++) {
    cin >> q;
    if (ar[q] > c)
      cout << ar[q] - c, c = ar[q];
    else
      cout << 0;
    cout << ' ';
  }
}
