# coding: utf-8

def manhattan(x1, y1, x2, y2):

    return abs(x1-x2) + abs(y1-y2)



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

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

c_points = [eval(input()) for _ in range(M)]



for s in students:

    val = 400000001

    ans = 0

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

    for j, c in enumerate(c_points):

        c, d = list(map(int, c.split()))

        m_dis = manhattan(a,b,c,d)

        if m_dis < val:

            val = m_dis

            ans = j+1

    print(ans)

# coding: utf-8

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

students = [list(map(int, input().split())) for _ in range(N)]

c_points = [list(map(int, input().split())) for _ in range(M)]



for a,b in students:

    m_dis = [abs(a-c) + abs(b-d) for c,d in c_points]

    print((m_dis.index(min(m_dis)) + 1))

# coding: utf-8
def manhattan(x1, y1, x2, y2):
    return abs(x1 - x2) + abs(y1 - y2)


N, M = list(map(int, input().split()))
students = [eval(input()) for _ in range(N)]
c_points = [eval(input()) for _ in range(M)]
for s in students:
    val = 400000001
    ans = 0
    a, b = list(map(int, s.split()))
    for j, c in enumerate(c_points):
        c, d = list(map(int, c.split()))
        m_dis = manhattan(a, b, c, d)
        if m_dis < val:
            val = m_dis
            ans = j + 1
    print(ans)

# coding: utf-8
N, M = list(map(int, input().split()))
students = [list(map(int, input().split())) for _ in range(N)]
c_points = [list(map(int, input().split())) for _ in range(M)]
for a, b in students:
    m_dis = [abs(a - c) + abs(b - d) for c, d in c_points]
    print((m_dis.index(min(m_dis)) + 1))

-def manhattan(x1, y1, x2, y2): -    return abs(x1 - x2) + abs(y1 - y2) - - -students = [eval(input()) for _ in range(N)] -c_points = [eval(input()) for _ in range(M)] -for s in students: -    val = 400000001 -    ans = 0 -    a, b = list(map(int, s.split())) -    for j, c in enumerate(c_points): -        c, d = list(map(int, c.split())) -        m_dis = manhattan(a, b, c, d) -        if m_dis < val: -            val = m_dis -            ans = j + 1 -    print(ans) +students = [list(map(int, input().split())) for _ in range(N)] +c_points = [list(map(int, input().split())) for _ in range(M)] +for a, b in students: +    m_dis = [abs(a - c) + abs(b - d) for c, d in c_points] +    print((m_dis.index(min(m_dis)) + 1))