# -*- coding: utf-8 -*-
# get a integer
# get two integers separated with half-width break
n, m = map(int, raw_input().split())
# get a string
nn = range(2*n)
mm = range(2*m)
for i in range(n):
    nn[i*2], nn[i*2 + 1] = map(int, raw_input().split())
for i in range(m):
    mm[i*2], mm[i*2 + 1] = map(int, raw_input().split())
#print nn,mm
for i in range(n):
    for j in range(m):
        s = abs(mm[j*2]-nn[i*2]) + abs(mm[j*2+1]-nn[i*2+1])
        if j == 0:
            ma = s
            p = j + 1
        elif s < ma:
            ma = s
            p = j + 1
    print p
