# -*- coding: utf-8 -*-
# Luis Yoichi Morales January 2019

from sys import stdin
import sys

def manhattan_dist(a, c):
    return  abs(a[0]-c[0]) + abs(a[1]-c[1])



N,M = map( int, raw_input().split() )
#print N, M


a=[]
c=[]
for i in range (N):
    a.append( map(int, stdin.readline().split()) )

for i in range (M):
    c.append( map(int, stdin.readline().split()) )

prev_dist=sys.maxint
index=[]
for i in range (N):
    for j in range (M):
        if prev_dist > manhattan_dist( a[i], c[j] ):
            index = (manhattan_dist( a[i], c[j] ), j+1 )
            prev_dist = manhattan_dist( a[i], c[j] )
    print index[1] 
    prev_dist=sys.maxint
