n,m=map(int,input())
a,b,c,d=[],[],[],[]
for i in range(n):
  o = list(map(int, input().split()))
  a.append(o[0])
  b.append(o[1])
for i in range(m):
  o = list(map(int, input().split()))
  c.append(o[0])
  d.append(o[1])
s = []
for i in range(n):
  g = float('inf')
  h = 0
  for j in range(m):
    if g > abs(a[i]-c[j])+abs(b[i]-d[j]):
      g = abs(a[i]-c[j])+abs(b[i]-d[j])
      h = j+1
  s.append(h)
for i in s:
  print(i)