#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

# Written by NoKnowledgeGG @YlePhan

#import math
#mod = 10**9+7



def main():
  n,m = map(int,input().split())
  
  AB = [map(int,input().split()) for _ in range(n)]
  #print(AB)
  CD = [map(int,input().split()) for _ in range(m)]
  idx = 1
  man = float("inf")
  for i in range(n):
    a,b = AB[i]
    for j in range(m-1,-1,-1):
      c,d = CD[j]
      if abs(a-c) + abs(b-d) <= man:
        man = abs(a-c) + abs(b-d)
        idx = j
      print(j+1)
      
  
if __name__ == '__main__':
  main()