package main
 
import(
  "fmt"
	"bufio"
	"os"
	"strings"
)
 
var sc = bufio.NewScanner(os.Stdin)
 
func Rr() []string {
  sc.Scan()
  slice := strings.Split(sc.Text(), " ")
  return slice
}
 
func abc057b(N int, M int){
	human_list := [][]int{}
	var a int
	var b int
	for i := 0; i < N; i++{
		fmt.Scan(&a)
		fmt.Scan(&b)
		ap := []int{a,b}
		human_list = append(human_list,ap)
	}
	point_list := [][]int{}
	for i := 0; i < M; i++{
		fmt.Scan(&a)
		fmt.Scan(&b)
		ap := []int{a,b}
		point_list = append(point_list,ap)
	}
	for j := 1; j <= N; j++{
		min := 10000000
		ans := 10000000
		for i := 1; i <= M; i++{
			x := human_list[j-1][0]-point_list[i-1][0]
			if x < 0{x=x*-1}
			y := human_list[j-1][1]-point_list[i-1][1]
			if y < 0{y=y*-1}
			current := x + y
			if current < min{
				ans = i
				min = current
			}
			fmt.Println(ans)
		}
		fmt.Println(ans)
	}
}
func main(){
	n,m := 0,0
	fmt.Scan(&n)
	fmt.Scan(&m)
	abc057b(n,m)
}