#include <bits/stdc++.h>
using namespace std;
long long powermod(long long _a, long long _b, long long _m) {
  long long _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a) % _m;
    _b /= 2;
    _a = (_a * _a) % _m;
  }
  return _r;
}
long long string_to_number(string s) {
  long long x = 0;
  stringstream convert(s);
  convert >> x;
  return x;
}
long long add(long long a, long long b) {
  long long x = (a % 1000000007 + b % 1000000007) % 1000000007;
  return x;
}
long long mul(long long a, long long b) {
  long long x = (a % 1000000007 * b % 1000000007) % 1000000007;
  return x;
}
long long sub(long long a, long long b) {
  long long x = (a - b + 1000000007) % 1000000007;
  return x;
}
long long divi(long long a, long long b) {
  long long x = a;
  long long y = powermod(b, 1000000007 - 2, 1000000007);
  long long res = (x * y) % 1000000007;
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a[n], b[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) cin >> b[i];
  long long already[200005] = {0};
  long long l = 0;
  for (long long i = 0; i < n; i++) {
    if (already[b[i]]) {
      cout << 0 << " ";
      continue;
    }
    long long cnt = 0;
    if (a[l] == b[i]) {
      cout << 1 << " ";
      l++;
      already[b[i]] = 1;
    } else {
      while (l < n) {
        cnt++;
        already[a[l]] = 1;
        if (a[l] == b[i]) {
          l++;
          break;
        }
        l++;
      }
      cout << cnt << " ";
      already[b[i]] = 1;
    }
  }
  return 0;
}
