#include <bits/stdc++.h>
const int N = 2e5 + 10;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
using namespace std;
bool vis[N];
int a[N];
int main() {
  int n;
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  int pos = 0;
  for (int i = 0, x; i < n; ++i) {
    cin >> x;
    if (vis[x])
      cout << 0 << " ";
    else {
      int tot = 0;
      for (int j = pos; j < n; ++j) {
        tot++;
        vis[a[j]] = 1;
        if (a[j] == x) {
          pos = j + 1;
          break;
        }
      }
      cout << tot << " ";
    }
  }
  return 0;
}
