import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int[][] students = new int[n][2];
		int[][] points = new int[m][2];
		for (int i = 0 ; i < n ; i++){
			students[i][0] = scanner.nextInt();
			students[i][1] = scanner.nextInt();
		}
		for (int i = 0 ; i < m ; i++){
			points[i][0] = scanner.nextInt();
			points[i][1] = scanner.nextInt();
		}
		
		int[] results = new int [n];
		for (int i = 0 ; i < n ; i++){
			int minIndex = 0;
			int minDist = Integer.MAX_VALUE;
			for (int j = 0 ; j < m ; j++){
				int dist = Math.abs(students[i][0] - points[j][0]) + Math.abs(students[i][1] - points[j][1]);
				if (dist < minDist){
					minDist = dist;
					minIndex = j;
				}			
			}
			results[i] = minIndex + 1;
		}
		for (int i = 0 ; i < n ; i++){
			System.out.println(results[i]);
		}
	}
} 