import math;
N,M=map(int,input().split(" "));
ab=[];
for i in range(0,N):
 ab.append(input().split(" "));
cd=[];
for i in range(0,M):
 cd.append(input().split(" "));
for j in range(0, N):
 dist=9999999999999
 nearm=0;
for j in range(0, M):
 dist2 = math.fabs(int(ab[i][0]) - int(cd[j][0])) + math.fabs(int(ab[i][1]) - int(cd[j][1]));
 if dist2 < dist:
  dist = dist2;
  nearm=j;
  print(nearm+1);
