import sys
from io import StringIO
import unittest

doTest=1

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline
    n,m=list(map(int, readline().strip().split()))
    a=[0]*n
    b=[0]*n
    c=[0]*m
    d=[0]*m

    for i in range(n):
        a[i],b[i]=list(map(int, readline().strip().split()))
    for i in range(m):
        c[i],d[i]=list(map(int, readline().strip().split()))

    for i in range(n):
        minDiff=999999999
        minpnt=9999999
        for j in range(m):
            diff=abs(a[i]-c[j])+abs(b[i]-d[j])
            if diff < minDiff:
                minDiff = diff
                minpnt=j
        print(minpnt+1)
    return

if doTest==0:
    resolve()
    sys.exit()

### ----------------
### ここまでコピぺえ 
### ----------------