#include <bits/stdc++.h>
using namespace std;
const long long SuperINF = 2 * 1e18;
const int MAX_SIZE = 2 * 1e6 + 15, INF = 2 * 1e9, MOD = 1e9 + 7;
const double eps = 1e-5;
map<int, int> used;
int cnt[MAX_SIZE];
queue<int> q;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int b;
    cin >> b;
    q.push(b);
  }
  for (int i = 0; i < n; i++) {
    int c;
    cin >> c;
    int now = 0;
    if (used[c] == 1) {
      cout << 0 << ' ';
    } else {
      while (q.front() != c) {
        int nn = q.front();
        q.pop();
        used[nn] = 1;
        now += 1;
      }
      used[c] = 1;
      now += 1;
      q.pop();
      cout << now << ' ';
    }
  }
  return 0;
}
