n, m = map(int, input().split())
ab = [list(map(int, input().split())) for x in range(n)]
cd = [list(map(int, input().split())) for x in range(m)]
for i in ab:
    atemp = 100000000
    ans = 0
    for f in range(len(cd)):
        temp = abs(i[0] - cd[f][0]) + abs(i[1] - cd[f][1])
        if atemp > temp:
            atemp = temp
            ans = f + 1
    print(ans)
