while(True):
    try:
        n, m = map(int, input().split())
    except EOFError:
        exit()
    a, b = [[0 for _ in range(n)] for i in range(2)]
    c, d = [[0 for _ in range(m)] for i in range(2)]
    for i in range(n):
        a[i], b[i] = map(int, input().split())
    for i in range(m):
        c[i], d[i] = map(int, input().split())
    for i in range(n):
        dist = 1 << 9
        ans = 0
        for j in range(m)[::-1]:
            ans = j + 1 if min(dist, abs(a[i] - c[j]) + abs(b[i] - d[j])) == abs(a[i] - c[j]) + abs(b[i] - d[j]) else ans
            dist = min(dist, abs(a[i] - c[j]) + abs(b[i] - d[j]))
        print(ans)