using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace zadatak2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            int[] a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            int[] b = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            for (int i = 0; i < b.Length; i++)
            {
                int manji = 0, veci = 0;
                for(int j = 0; j < a.Length; j++)
                {
                    if (a[j] > b[i]) veci++;
                    else if(a[j] < b[i]) manji++;
                }
                int isti = a.Length - veci - manji;
                if (isti > 0)
                {
                    if (manji >= veci)
                    {
                        Console.WriteLine(Math.Max(manji - veci - isti, 0));
                    }
                    else Console.WriteLine(Math.Max(veci - manji - isti + 1, 0));
                }
                else
                {
                    if (manji > veci)
                    {
                        Console.WriteLine(manji - veci);
                    }
                    else if (manji < veci)
                    {
                        Console.WriteLine(veci - manji + 1);
                    }
                    else Console.WriteLine("1");
                }
            }
        }
    }
}