import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int M = scan.nextInt();
		int a[] = new int[N];
		int b[] = new int[N];
		int c[] = new int[M];
		int d[] = new int[M];
		int min = 99999999;
		int index = 0;
		
		for(int i=0;i<N;i++){
			a[i] = scan.nextInt();
			b[i] = scan.nextInt();
		}
		
		for(int i=0;i<M;i++){
			c[i] = scan.nextInt();
			d[i] = scan.nextInt();
		}
		
		for(int i=0;i<N;i++){
			for(int j=0;j<M;j++){
				if(Math.abs(a[i]-c[j])+Math.abs(b[i]-d[j]) < min){
					min = Math.abs(a[i]-c[j])+Math.abs(b[i]-d[j]);
					index = j;
				}
			}
			System.out.println(index+1);
			min = 999999999;
			index = 0;
		}
			
	}

}
