#include <bits/stdc++.h>
using namespace std;
long long int pow_mod(long long int a, long long int b) {
  long long int res = 1;
  while (b != 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b /= 2;
  }
  return res;
}
long long int inv_mod(long long int x) { return pow_mod(x, 1000000007 - 2); }
const long long int N = (long long int)3e5;
long long int inv[N];
long long int fac[N];
void init() {
  fac[0] = 1;
  for (long long int i = 1; i < N; i++) fac[i] = (i * fac[i - 1]) % 1000000007;
  for (long long int i = 0; i < N; i++) inv[i] = inv_mod(fac[i]);
}
long long int ncr(long long int n, long long int r) {
  if (n < r) return 0;
  if (n == r || r == 0) return 1LL;
  long long int x = fac[n];
  long long int y = inv[n - r];
  long long int z = inv[r];
  return ((x * y) % 1000000007 * z) % 1000000007;
}
bool test_cases = 0;
void solve() {
  long long int n;
  cin >> n;
  long long int a[n], b[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long int i = 0; i < n; i++) {
    cin >> b[i];
  }
  long long int id[n + 1];
  for (long long int i = 0; i < n; i++) {
    id[a[i]] = i;
  }
  bool mark[n];
  memset(mark, false, sizeof(mark));
  for (long long int i = 0; i < n; i++) {
    long long int j = id[b[i]];
    long long int res = 0;
    while (j >= 0 && !mark[j]) {
      ++res;
      mark[j] = true;
      --j;
    }
    cout << res << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  if (test_cases) cin >> t;
  while (t--) solve();
  return 0;
}
