#include <bits/stdc++.h>
using namespace std;
const long long MaxM = 1e17;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void SieveOfEratosthenes(vector<long long> &v, long long n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (int p = 2; p <= n; p++)
    if (prime[p]) {
      v.push_back(p);
    }
}
bool isPowerOfTwo(int x) { return x && (!(x & (x - 1))); }
long long binpow2(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first) {
    return a.second < b.second;
  }
  return a.first < b.first;
}
void solve() {
  int n;
  cin >> n;
  int a[n], b[n + 1];
  bool c[n];
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    c[i] = true;
    cin >> a[i];
    b[a[i]] = i;
  }
  int x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    cnt = 0;
    for (int j = b[x]; j >= 0; j--) {
      if (c[j] == false) {
        break;
      }
      c[j] = false;
      cnt++;
    }
    cout << cnt << " ";
  }
  cout << endl;
}
int main() {
  fast();
  int t = 1;
  while (t--) {
    solve();
  }
}
