import java.util.Scanner;

/**
 * Created by zzt on 17-3-26.
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        int[] c = new int[m];
        int[] d = new int[m];

        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextInt();
            b[i] = scanner.nextInt();
        }

        for (int i = 0; i < m; i++) {
            c[i] = scanner.nextInt();
            d[i] = scanner.nextInt();
        }

        int curDis, minDis, minIndex;
        for (int i = 0; i < n; i++) {
            minDis = Math.abs(a[i] - c[0]) + Math.abs(b[i] - d[0]);
            minIndex = 0;
            for (int j = 0; j < m; j++) {
                curDis = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
                if (curDis < minDis) {
                    minDis = curDis;
                    minIndex = j;
                }
            }
            System.out.println(minIndex + 1);
        }
    }
}