Vasya has got n books, numbered from 1 to n, arranged in a stack. The topmost book has number a_1, the next one — a_2, and so on. The book at the bottom of the stack has number a_n. All numbers are distinct.

Vasya wants to move all the books to his backpack in n steps. During i-th step he wants to move the book number b_i into his backpack. If the book with number b_i is in the stack, he takes this book and all the books above the book b_i, and puts them into the backpack; otherwise he does nothing and begins the next step. For example, if books are arranged in the order [1, 2, 3] (book 1 is the topmost), and Vasya moves the books in the order [2, 1, 3], then during the first step he will move two books (1 and 2), during the second step he will do nothing (since book 1 is already in the backpack), and during the third step — one book (the book number 3). Note that b_1, b_2, ..., b_n are distinct.

Help Vasya! Tell him the number of books he will put into his backpack during each step.

Input

The first line contains one integer n~(1 ≤ n ≤ 2 ⋅ 10^5) — the number of books in the stack.

The second line contains n integers a_1, a_2, ..., a_n~(1 ≤ a_i ≤ n) denoting the stack of books.

The third line contains n integers b_1, b_2, ..., b_n~(1 ≤ b_i ≤ n) denoting the steps Vasya is going to perform.

All numbers a_1 ... a_n are distinct, the same goes for b_1 ... b_n.

Output

Print n integers. The i-th of them should be equal to the number of books Vasya moves to his backpack during the i-th step.

Examples

Input

3
1 2 3
2 1 3


Output

2 0 1 


Input

5
3 1 4 2 5
4 5 1 3 2


Output

3 2 0 0 0 


Input

6
6 5 4 3 2 1
6 5 3 4 2 1


Output

1 1 2 0 1 1 

Note

The first example is described in the statement.

In the second example, during the first step Vasya will move the books [3, 1, 4]. After that only books 2 and 5 remain in the stack (2 is above 5). During the second step Vasya will take the books 2 and 5. After that the stack becomes empty, so during next steps Vasya won't move any books.
import  java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.*;
import java.math.*;
import java.io.*;

public class hacker
{  

    /*Fatt Gyi Bhai*/
    //Dekh le mera code
    public static boolean[] sieve(long n)
    {
        boolean[] prime = new boolean[(int)n+1];
        Arrays.fill(prime,true);
        prime[0] = false;
        prime[1] = false;
        long m = (long)Math.sqrt(n);
        for(int i=2;i<=m;i++)
        {
            if(prime[i])
            {
                for(int k=i*i;k<=n;k+=i)
                {
                    prime[k] = false;
                }
            }
        }
        return prime;
    } 

    
    static long GCD(long a,long b)
    {
        if(a==0 || b==0)
        {
            return 0;
        }
        if(a==b)
        {
            return a;
        }
        if(a>b)
        {
            return GCD(a-b,b);
        }
        return GCD(a,b-a);
    }

    static long CountCoPrimes(long n)
    {
        long res = n;
        for(int i=2;i*i<=n;i++)
        {
            if(n%i==0)
            {
                while(n%i==0)
                {
                    n/=i;
                }
                res-=res/i;
            }
        }
        if(n>1)
        {
            res-=res/n;
        }
        return res;
    }

    static long modularExponentiation(long x,long n,long m)
    {
        long res = 1;
        while(n>0)
        {
            if(n%2==1)
            {
                res = (res*x)%m;
            }
            x =(x*x)%m;
            n/=2;
        }
        return res;
    }

    static long lcm(long a,long b)
    {
        return (a*b)/GCD(a,b);
    }

   
    static long pow(long a,long b)
    {
        long res = 1;
        while(b>0)
        {
            if((b&1)==1)
            {
                res *= a;
            }

            b >>= 1;
            a *=a;
        }
        return res;
    }

   static long modInverse(long A,long M)
   {
    return modularExponentiation(A,M-2,M);
   }
   static long factorial(long n) 
    { 
        String ooo="";
        long res[] = new long[500]; 
  
        // Initialize result 
        res[0] = 1; 
        long res_size = 1; 
  
        
        for (long x = 2; x <= (int)n; x++) 
        {
            res_size = multiply(x, res, res_size); 
        }

        for (int i = (int)res_size - 1; i >= 0; i--) 
        {
            ooo+=res[i];
        }
        return Long.parseLong(ooo);
    } 
   
    static long multiply(long x, long res[], long res_size) 
    { 
        long carry = 0; // Initialize carry 
  
        // One by one multiply n with individual  
        // digits of res[] 
        for (int i = 0; i <(int) res_size; i++) 
        { 
            long prod = res[i] * x + carry; 
            res[i] = prod % 10; // Store last digit of  
                                // 'prod' in res[] 
            carry = prod/10; // Put rest in carry 
        } 
  
        // Put carry in res and increase result size 
        while (carry!=0) 
        { 
            res[(int)res_size] = carry % 10; 
            carry = carry / 10; 
            res_size++; 
        } 
        return res_size; 
    } 

    static void reverse(long[] a)
    {
        int start=0;
        int end = a.length-1;
        while(start<end)
        {
            long temp = a[start];
            a[start] = a[end];
            a[end] = temp;
            start++;
            end--;
        }

    }
  
    public static void main(String[] args) throws IOException
    {
       // in = new Scanner(new File("explicit.in"));
        //out = new PrintWriter("explicit.out");
        new hacker().run();
       
    }

    
   
   static Scanner sc = new Scanner(System.in);
    static void run() throws IOException
    {
        int t = sc.nextInt();
        int[] a = new int[t+1];
        int[] b = new int[t+1];
        int[] index = new int[t+1];
        for(int i=1;i<=t;i++)
        {
            a[i] = ni();
            index[a[i]] = i;
        }
        for(int i=1;i<=t;i++)
        {
            b[i] = ni();
        }
        int cpp=-1;
        for(int i=1;i<=t;i++)
        {

           if(index[b[i]]>=cpp)
           {
                if(cpp<0)
                {
                    cpp = 0;
                }
                System.out.print(index[b[i]]-cpp+" ");
                cpp = index[b[i]];
            }
            else
            {
                System.out.print(0+" ");
            }

        }
       

        
    }

    static void print(long a)
    {
        System.out.println(a);
    }

    static int myabs(int n)
    {
        if(n>0)
        {
            return n;
        }
        else
        {
            return 1+abs(n);
        }
    }
   
   
    static void swap(char c,char p)
    {
        char t = c;
        c = p;
        p = t;
    }

    static int max(int n,int m)
    {
        return Math.max(n,m);
    }
    static long min(long n,long m)
    {
        return Math.min(n,m);
    }

    static double nd() throws IOException
    {
        return Double.parseDouble(sc.next());
    }
    static int ni() throws IOException
    {
        return Integer.parseInt(sc.next());
    }

    static long nl() throws IOException
    {
        return Long.parseLong(sc.next());
    }

    static String si() throws IOException
    {
        return sc.next();
    }


  
   
    static int abs(int n)
    {
        return Math.abs(n);
    }
   
    
    
    static class Scanner 
    {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s){  br = new BufferedReader(new InputStreamReader(s));}

        public String next() throws IOException 
        {
            while (st == null || !st.hasMoreTokens()) 
            {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}
        
        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public boolean ready() throws IOException {return br.ready();}


    }

   


    
}

   
