package main

import (
	"bufio"
	"fmt"
	"strconv"
	"strings"
	"os"
)

func readLine(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func readInt(sc *bufio.Scanner) (res int) {
	res, _ =strconv.Atoi(readLine(sc))
	return
}

func readInts(sc *bufio.Scanner, n int) []int {
	ns := strings.Split(readLine(sc), " ")
	res := make([]int, n)

	for i, n := range ns {
		res[i], _ = strconv.Atoi(n)
	}
	return res
}

func readInt64s(sc *bufio.Scanner, n int) []int64 {
	ns := strings.Split(readLine(sc), " ")
	res := make([]int64, n)

	for i, n := range ns {
		res[i], _ = strconv.ParseInt(n, 10, 64)
	}
	return res
}

func readMatrix(sc *bufio.Scanner, rows, cols int) [][]int {
	res := make([][]int, rows)
	for i := 0; i < rows; i ++ {
		res[i] = readInts(sc, cols)
	}
	return res
}

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

func main() {
	sc := bufio.NewScanner(os.Stdin)

	xs := readInts(sc, 2)
	n := xs[0]
	m := xs[1]

	students := readMatrix(sc, n, 2)
	points := readMatrix(sc, m, 2)

	for _, s := range students {
		x := s[0]
		y := s[0]

		min_i := -1
		min := 1000000000
		for j := len(points) - 1; j >= 0; j-- {
			u := points[j][0]
			v := points[j][1]

			d := abs(u - x) + abs(v - y)
			if d <= min {
				min_i = j
			}
		}

		fmt.Println(min_i + 1)
	}
}