#include <bits/stdc++.h>
using namespace std;
long long n, i;
string s;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
bool iseven(int n) { return ((n & 1) == 0) ? true : false; }
int pov(int n, int m) {
  int c = 1;
  while (m > 0) {
    if (!iseven(m)) {
      c = c * n;
    }
    n = n * n;
    m = m >> 1;
  }
  return c;
}
unsigned int intlen(unsigned int n) { return n ? intlen(n / 10) + 1 : 0; }
int main() {
  cin >> n;
  map<long long, long long> mp;
  long long arr[n];
  for (long long i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    mp[x] = i;
  }
  for (long long i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  int a = 0;
  for (int i = 1; i <= n; i++) {
    long long temp = mp.find(arr[i])->second;
    if (temp > a) {
      cout << temp - a << " ";
      a = temp;
    } else
      cout << 0 << " ";
  }
  return 0;
}
