import java.util.*;

//クラス名をMainに
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];
		int[] c = new int[M];
		int[] d = new int[M];
		int i,j;
		int min = 0;
		int num = 0;
		
		for(i = 0; i < N; i++){
			 a[i] = sc.nextInt();
			 b[i] = sc.nextInt();
		}
		for(i = 0; i < M; i++){
			 c[i] = sc.nextInt();
			 d[i] = sc.nextInt();
		}
		//Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
		for(i = 0; i < N; i++){
			min = Math.abs(a[i] - c[0]) + Math.abs(b[i] - d[0]);
			num = 0;
			for(j = 0; j < M; j++){
				if(min > Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j])){
					min = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
					num = j;
				}
			}
			System.out.println(num + 1);
		}
		
	}
}
