using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		for(int i=0;i<N;i++){
			int min = (int)1e9;
			int idx = -1;
			for(int j=0;j<M;j++){
				if(Dist(A[i],B[i],C[j],D[j]) < min){
					min = Dist(A[i],B[i],C[j],D[j]);
					idx = j;
				}
			}
			Console.WriteLine(idx+1);
		}
		
		
		
	}
	
	static int Dist(int x1, int y1, int x2, int y2){
		return Math.Abs(x1-x2) + Math.Abs(y1-y2);
	}
	
	int N,M;
	int[] A,B,C,D;
	public Sol(){
		var d = ria();
		N = d[0]; M = d[1];
		A = new int[N]; B = new int[N];
		for(int i=0;i<N;i++){
			d = ria();
			A[i] = d[0];
			B[i] = d[1];
		}
		
		C = new int[N]; D = new int[N];
		for(int i=0;i<M;i++){
			d = ria();
			C[i] = d[0];
			D[i] = d[1];
		}

	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}
