# B - Checkpoints
def main():
    n, m = map(int, input().split())
    a_b = [input().split() for i in range(n)]
    c_d = [input().split() for i in range(m)]

    for i in range(m):
        temp = []
        for j in range(n):
            temp.append(abs(int(a_b[j][0])-int(c_d[i][0]))+abs(int(a_b[j][1])-int(c_d[i][1])))
        else:
            print(temp.index(min(temp))+1)


        
if __name__ == '__main__':
    main()