import java.util.Scanner;

public class Main {
	static Scanner in = new Scanner(System.in);

	public static void main(String[] args) {
		int N = in.nextInt();
		int M = in.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] = in.nextInt();
			b[i] = in.nextInt();
		}
		for(int i = 0; i < M; i++){
			c[i] = in.nextInt();
			d[i] = in.nextInt();
		}
		int p = 0;
		for(int i = 0; i < N; i++){
			int min = Integer.MAX_VALUE;
			for(int 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]);
					p = j + 1;
				}
			}
			System.out.println(p);
		}
	}
}
