#!/usr/bin/env python

nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]

student = list()
point = list()

for i in range(n):
    student.append([int(a) for a in input().split()])

for j in range(m):
    point.append([int(b) for b in input().split()])


mat = [[abs(student[i][0]-point[j][0]) + abs(student[i][1]-point[j][1]) for j in range(m)] for i in range(m)]

for i in range(n):
    print(mat[i].index(min(mat[i]))+1)