def main():

    N, M = list(map(int, input().split()))

    students = [input().split() for _ in range(N)]

    checkpoints = [input().split() for _ in range(M) ]

    nearest = [None]*N



    for i, s in enumerate(students) :

        min_d = 10**9

        index = 0



        for j, p in enumerate(checkpoints, 1) :

            a, b = list(map(int, s))

            c, d = list(map(int, p))

            d = abs(a - c) + abs(b - d)



            if min_d > d:

                min_d = d

                index = j



        nearest[i] = index



    for i in range(N):

        print((nearest[i]))   

main()

def main():

    N, M = list(map(int, input().split()))

    students = [input().split() for _ in range(N)]

    checkpoints = [input().split() for _ in range(M) ]

    nearest = [None]*N



    for i, s in enumerate(students) :

        min_d = 10**9



        for j, p in enumerate(checkpoints, 1) :

            a, b = list(map(int, s))

            c, d = list(map(int, p))

            d = abs(a - c) + abs(b - d)



            if min_d > d:

                min_d = d

                nearest[i] = j



    for i in range(N):

        print((nearest[i]))   

main()
def main():
    N, M = list(map(int, input().split()))
    students = [input().split() for _ in range(N)]
    checkpoints = [input().split() for _ in range(M)]
    nearest = [None] * N
    for i, s in enumerate(students):
        min_d = 10**9
        index = 0
        for j, p in enumerate(checkpoints, 1):
            a, b = list(map(int, s))
            c, d = list(map(int, p))
            d = abs(a - c) + abs(b - d)
            if min_d > d:
                min_d = d
                index = j
        nearest[i] = index
    for i in range(N):
        print((nearest[i]))


main()

def main():
    N, M = list(map(int, input().split()))
    students = [input().split() for _ in range(N)]
    checkpoints = [input().split() for _ in range(M)]
    nearest = [None] * N
    for i, s in enumerate(students):
        min_d = 10**9
        for j, p in enumerate(checkpoints, 1):
            a, b = list(map(int, s))
            c, d = list(map(int, p))
            d = abs(a - c) + abs(b - d)
            if min_d > d:
                min_d = d
                nearest[i] = j
    for i in range(N):
        print((nearest[i]))


main()

-        index = 0 -                index = j -        nearest[i] = index +                nearest[i] = j