import java.util.Scanner;

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];
		for(int i=0; i<N; i++){
			a[i]  = sc.nextInt();
			b[i]  = sc.nextInt();
		}
		for(int i=0; i<M; i++){
			c[i]  = sc.nextInt();
			d[i]  = sc.nextInt();
		}
		
		int[] ans = new int[N];
		double min = 0;
		double temp = 0;
		for(int i=0; i<N; i++){
			min = Math.abs((double)a[i]-(double)c[0])+Math.abs((double)b[i]-(double)d[0]);
			ans[i] = 0;
			for(int j=1; j<M; j++){
				temp =Math.abs((double)a[i]-(double)c[j])+Math.abs((double)b[i]-(double)d[j]);
				if(temp<min){
					min = temp;
					ans[i] = j;
				}
				
			}
		}
		
		for(int i=0; i<N; i++){
			System.out.println(ans[i]+1);
		}
		
		
	}

}
