
if __name__ == '__main__':
    a, b = map(int, input().split())
    lista=[]
    for i in range(a):
        c = [int(i) for i in input().split()]
        lista.append(c)

    listb=[]
    for i in range(b):
        c = [int(i) for i in input().split()]
        listb.append(c)

    listc =[]

    for i in lista:
        min = 51*51
        minroot=-1
        for j in range(len(listb)):
            root = (i[0] - listb[j][0])  + (i[1] - listb[j][1])
            if root <min:
                min =root
                minroot=j+1
        listc.append(minroot)
    for i in listc:
        print(i)
