# -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :

"""
#
# author:   noname
# url:      https://github.com/pettan0818
# license:  mit license
# created: 木 10/12 18:57:45 2017

# usage
#
"""
import math


def calc_distance(student_post, checkpoint_post):
    return int(math.fabs(student_post[0] - checkpoint_post[0]) + math.fabs(student_post[1] - checkpoint_post[1]))


if __name__ == '__main__':
    import doctest
    doctest.testmod()

    first = input()
    first = first.split(" ")
    data = [int(line) for line in first]

    student_num = data[0]
    checkpoint_num = data[1]

    student_pos_data = [[int(i) for i in input().split(" ")] for i in range(student_num)]
    checkpoint_data = [[int(i) for i in input().split(" ")] for i in range(checkpoint_num)]
    print(student_pos_data)
    print(checkpoint_data)

    for each_student in student_pos_data:
        dis_list = [calc_distance(each_student, i) for i in checkpoint_data]
        print(dis_list)
        print(dis_list.index(min(dis_list)) + 1)
