#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
double PI = 4 * atan(1);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int stack_order[200005] = {};
  int pack_order[200005] = {};
  int seen[200005] = {};
  for (int i = 0; i < n; i++) {
    cin >> stack_order[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> pack_order[i];
  }
  int pointer = 0;
  for (int i = 0; i < n; i++) {
    int curr = pack_order[i];
    if (seen[curr] == 1) {
      cout << 0 << ' ';
    } else {
      int moves = 0;
      while (stack_order[pointer] != curr) {
        seen[stack_order[pointer]] = 1;
        pointer += 1;
        moves += 1;
      }
      seen[curr] = 1;
      pointer += 1;
      cout << moves + 1 << ' ';
    }
  }
}
