N, M = map(int, input().split())
ab = [tuple(map(int, input().split())) for i in range(N)]

cd = [tuple(map(int, input().split())) for i in range(M)]


for a, b in ab:
    ret = -1
    dis = 10**20
    for i, x in enumerate(cd):
        c, d = x
        if dis > (c-a)**2 + (d-b)**2:
            dis = (c-a)**2 + (d-b)**2
            ret = i
    print(ret+1)
