import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt(),m = scanner.nextInt();
		int[] studentx = new int[n];
		int[] studenty = new int[n];
		int[] checkx = new int[m];
		int[] checky = new int[m];
		for(int i=0;i<n;i++){
			studentx[i] = scanner.nextInt();
			studenty[i] = scanner.nextInt();
		}
		for(int i=0;i<m;i++){
			checkx[i] = scanner.nextInt();
			checky[i] = scanner.nextInt();
		}
		int[] result = new int[n];
		for(int i=0;i<n;i++){
			int min = Integer.MAX_VALUE;
			int x = 0;
			for(int j=0;j<m;j++){
				int dis = Math.abs(studentx[i] - checkx[j]) + Math.abs(studenty[i] - checky[j]);
				if(dis < min){
					min = dis;
					x = j;
				}
			}
			result[i] = x + 1;
		}
		for(int i=0;i<n;i++){
			System.out.println(result[i]);
		}
	}

}
