import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			int n=sc.nextInt(),m=sc.nextInt();
			int[] a=new int [n],b=new int[n],c=new int [m],d=new int[m];
			for(int i=0;i<n;i++){
				a[i]=sc.nextInt(); b[i]=sc.nextInt();
			}
			for(int i=0;i<m;i++){
				c[i]=sc.nextInt(); d[i]=sc.nextInt();
			}
			for(int i=0;i<n;i++){
				int ans=0;
				for(int j=1;j<m;j++) if(Math.abs(a[i]-c[ans])+Math.abs(b[i]-d[ans])>Math.abs(a[i]-c[j])+Math.abs(b[i]-d[j])) ans=j;
				System.out.println(ans+1);
			}
		}
	}
}