import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		Pos[] ss = new Pos[N];
		Pos[] ps = new Pos[M];
		for(int i=0; i<N; i++){
			ss[i] = new Pos();
			ss[i].x = sc.nextInt();
			ss[i].y = sc.nextInt();
		}
		for(int i=0; i<M; i++){
			ps[i] = new Pos();
			ps[i].x = sc.nextInt();
			ps[i].y = sc.nextInt();
		}
		sc.close();
		
		int[] ans = new int[N];
		for(int n=0; n<N; n++){
			Pos s = ss[n];
			long min = Long.MAX_VALUE;
			for(int i=0; i<M; i++){
				Pos p = ps[i];
				long d = (long) (Math.abs(s.x - p.x) + Math.abs(s.y - p.y));
				if(d<min){
					min = d;
					ans[n] = i+1;
				}
			}
		}
		
	
		for(int a: ans){
			System.out.println(a);
		}

	}
	
	private static class Pos {
		long x;
		long y;
	}

}