def search(x):
l=0
r=n-1
while l<r:
mid = int((l+r)/2)
if int(a[mid])>=x :
r = mid
else :
l = mid+1
if int(a[l])==x:
return l+1
else:
return -1
n,m=map(int,input().split())
a=input().split()
k=input().split()
for i in range(m):
q = int(k[i])
loc = search(q)
print(loc,end=' ')
前三个AC,后三个TLE