#include <bits/stdc++.h>
using namespace std;
const int nax = 1e5 + 10;
bool vis[nax];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  memset(vis, false, sizeof(vis));
  int n;
  cin >> n;
  int a[n], b[n];
  map<int, int> m;
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    cin >> a[i];
    m[a[i]] = i + 1;
  }
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n)))
    cin >> b[i];
  int last = 0;
  cout << m[b[0]] << " ";
  last = m[b[0]];
  for (__typeof(n) i = (1) - ((1) > (n)); i != (n) - ((1) > (n));
       i += 1 - 2 * ((1) > (n))) {
    int x = b[i];
    if (m[x] < last)
      cout << 0 << " ";
    else {
      cout << m[x] - last << " ";
      last = m[x];
    }
  }
  return 0;
}
