package main

import "fmt"

var inf = 100000000

func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	a := make([]int, n)
	b := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i], &b[i])
	}
	c := make([]int, m)
	d := make([]int, m)
	for i := 0; i < m; i++ {
		fmt.Scan(&c[i], &d[i])
	}

	for i := 0; i < n; i++ {
		min := inf
		ans := 0
		for j := 0; j < m; j++ {
			distance := abs(a[i]-c[j]) + abs(b[i]-d[j])
			if distance < min {
				min = distance
				ans = j + 1
			}
		}
		fmt.Println(ans)
	}
}
