#include <bits/stdc++.h>
using namespace std;
long long mult(long long a, long long b, long long p = (int)(1e9 + 7)) {
  return ((a % p) * (b % p)) % p;
}
long long add(long long a, long long b, long long p = (int)(1e9 + 7)) {
  return (a % p + b % p) % p;
}
long long fpow(long long n, long long k, long long p = (int)(1e9 + 7)) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
long long inv(long long a, long long p = (int)(1e9 + 7)) {
  return fpow(a, p - 2, p);
}
bool sa(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
bool fd(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
bool sd(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second > b.second);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, c = 0;
  cin >> n;
  long long a[n + 5];
  long long b[n + 5];
  long long hash[200005];
  for (long long i = 0; i < 200005; i++) {
    hash[i] = 0;
  }
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    hash[a[i]] = i;
  }
  for (long long i = 0; i < n; i++) {
    cin >> b[i];
  }
  long long begin = 0;
  for (long long i = 0; i < n; i++) {
    if (hash[b[i]] >= begin) {
      c = hash[b[i]] - begin;
      cout << c + 1 << " ";
      begin = begin + c + 1;
    } else
      cout << "0 ";
  }
  return 0;
}
