package main

import (
	"fmt"
	"math"
)

func main() {
	// Code for B - Checkpoints
	var N, M int
	fmt.Scanf("%d %d", &N, &M)

	a := make([]int, N)
	b := make([]int, N)

	for i := 0; i < N; i++ {
		fmt.Scanf("%d %d", &a[i], &b[i])
	}

	c := make([]int, M)
	d := make([]int, M)
	for i := 0; i < M; i++ {
		fmt.Scanf("%d %d", &c[i], &d[i])
	}

	var ans int
	for i := 0; i < N; i++ {
		min := 100000000
		for j := 0; j < M; j++ {
			temp := int(math.Abs(float64(a[i]-c[j])) + math.Abs(float64(b[i]-d[j])))
			if min > temp {
				min = temp
				ans = j + 1
			}
		}
		fmt.Println(ans)
	}
}
