import sys

input = sys.stdin.readline

def main():
    n,m = map(int, input().split())
    s = []
    p = []
    min = [10**8]*n
    ans = [0]*n
    for _ in range(n):
        s.append(list(map(int, input().split())))
    for _ in range(m):
        p.append(list(map(int, input().split())))
    for i in range(n):
        a, b = s[i]
        for j in reversed(range(m)):
            c,d  = p[j]
            md = abs(a-c) + abs(b-d)
            if md <= min[i]:
                min[i] = md
                ans[i] = j+1
    for i in ans:
        print(i)

if __name__ == '__main__':
    main()