#!/usr/bin/env python

N,M=map(int,raw_input().split())
a=[0]*N
b=[0]*N
c=[0]*M
d=[0]*M
for i in range(N):
    a[i],b[i]=map(int,raw_input().split())
for j in range(M):
    c[j],d[j]=map(int,raw_input().split())
for i in range(N):
    dist=[0]*M
    for j in range(M):
        dist[j]=abs(a[i]-c[j])+abs(b[i]-d[j])
        #print "student"+str(i)+": distance "+str(dist[j])
    print [i for i,x in enumerate(dist) if x==min(dist)][0]+1
