import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
		}
		int[] c = new int[m];
		int[] d = new int[m];
		for(int j = 0; j < m; j++) {
			c[j] = sc.nextInt();
			d[j] = sc.nextInt();
		}

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