using System;
class Program
{
    
    public static void Main()
    {
        int lol, q;

        string[] hmm = Console.ReadLine().Split();

        lol = int.Parse(hmm[0]);
        q = int.Parse(hmm[1]);

        int[] a = new int[lol];
        int[] b = new int[q];

        hmm = Console.ReadLine().Split();

        for (int i = 0; i < lol; i++)
        {
            a[i] = int.Parse(hmm[i]);
        }
        Array.Sort(a);
        hmm = Console.ReadLine().Split();
        for (int i = 0; i < hmm.Length; i++)
        {
            b[i] = int.Parse(hmm[i]);
        }
        List<int> lista = new List<int>(a);

        int[] brL = new int[q];

        for (int i = 0; i < q; i++)
        {
            lista.Add(b[i]);


            lista.Sort();

            int bi = 0;
            for (int j = 0; j < lista.Count; j++)
            {
                if (lista[j] == b[i])
                {
                    bi = j;
                }
            }
            int br1 = 0;
            int br2 = 0;
            for (int j = 0; j < bi; j++)
            {
                br1++;
            }
            for (int j = bi; j > lista.Count; j++)
            {
                br2++;
            }
            int br = 0;
            while (br1 != br2 - 1)
            {
                br1++;
                br++;
            }
            brL[i] = br;
            lista.RemoveAt(bi);
            lista.Sort();
        }

        for (int i = 0; i < q; i++)
        {
            Console.WriteLine(brL[i]);
        }
    }
}