from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]
li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(n)]
lc = [list(map(int,stdin.readline().rstrip().split())) for _ in range(m)]

for i in range(n):
    kyo = []
    for j in range(m):
        kyo.append(abs(li[i][0]-lc[j][0])+abs(li[i][0]-lc[j][1]))
    print(kyo.index(min(kyo))+1)