#include <bits/stdc++.h>
const int N = 2e5 + 5;
const long double pi = 3.141592653;
const long long MOD = 1e9 + 7;
const long long mod = 998244353;
const long long INF = 9223372036854775807LL;
using namespace std;
int dx[9] = {1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9] = {0, 0, 1, -1, 1, -1, 1, -1, 0};
int n, i, pmax;
vector<int> pos(N), a(N), b(N);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    cin >> n;
    pmax = -1;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      pos[a[i]] = i;
    }
    for (i = 0; i < n; i++) {
      cin >> b[i];
      if (pmax == -1) {
        cout << pos[b[i]] + 1;
        pmax = pos[b[i]] + 1;
      } else {
        if (pos[b[i]] + 1 < pmax)
          cout << 0;
        else
          cout << pos[b[i]] + 1 - pmax;
        pmax = max(pmax, pos[b[i]] + 1);
      }
      cout << " ";
    }
  }
  return 0;
}
