#include <bits/stdc++.h>
using namespace std;
const int M = 1e6 + 7;
bool isPrime[M];
vector<long long> prime;
int p[M];
void seive() {
  for (long long i = 2; i < M; i++) {
    if (isPrime[i]) continue;
    prime.push_back(i);
    for (long long j = i + i; j < M; j += i) isPrime[j] = true;
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    p[x] = i;
  }
  int idx = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (p[x] > idx) {
      cout << p[x] - idx << ' ';
      idx = p[x];
    } else
      cout << "0 ";
  }
  return 0;
}
