import sys

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def dist(x1, y1, x2, y2):
    return abs(x1 - x2) + abs(y1 - y2)

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func()
    top_str = input_raw.strip().split()
    [N, M] = [int(top_str[0]), int(top_str[1])]

    student_list = []
    checkpoint_list = []
    for i in range(N):
        input_raw = read_func().split()
        (a, b) = (int(input_raw[0]) , int(input_raw[1]))
        student_list.append((a,b))

    for i in range(M):
        input_raw = read_func().split()
        (c, d) = (int(input_raw[0]) , int(input_raw[1]))
        checkpoint_list .append((c, d))

    for i in range(N):
        min_checkpoint = 0
        min_dist = sys.maxint
        studentpoint = student_list[i]
        for j in range(M):
            checkpoint = checkpoint_list[j]
            d = dist(studentpoint[0], studentpoint[1], checkpoint[0], checkpoint[1])
            if d < min_dist:
                min_checkpoint = j
                min_dist = d
        print min_checkpoint + 1


if __name__ == '__main__':
    main()