n, q =input().split()
n=int(n)
q=int(q)
niz = list(map(int, input(). split()))
medijane= list(map(int, input(). split()))
niz1=[]
for f in range(len(niz)-1):
    for g in range(f+1,len(niz)):
        if niz[g]<niz[f]:
            cmd=niz[f]
            niz[f]=niz[g]
            niz[g]=cmd
for i in range(len(medijane)):
    if medijane[i] in niz:
        for j in range(1000):
            if niz[(n+j)//2]==medijane[i]:
                print(j)
                break
for e in range(len(medijane)):
    if medijane[i] not in niz:
        niz.append(medijane[i])
        niz1.append(medijane[i])
        n+=1
for d in range(len(niz1)):
    for c in range(1000):
        if niz[(n+c)//2]==niz1[d]:
            print(c+1)
            break