package main

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

func main() {
	scan_init()
	n := scanInt()
	m := scanInt()
	a:= make([]int, n)
	b:= make([]int, n)
	c:= make([]int, m)
	d:=make([]int, m)
	for i:=0; i<n; i++ {
		a[i] = scanInt()
		b[i] = scanInt()
	}
	for i:=0; i<m; i++ {
		c[i] = scanInt()
		d[i] = scanInt()
	}
	for i:=0; i<n; i++ {
		take := 2*int(math.Pow(10,8))
		check := 0
		for j:= 0; j<m; j++ {
			get := a[i] - c[j]
			if get<0 {
				get = -get
			}
			more := b[i] -d[j]
			if more<0 {
				more = -more
			}
		// 	fmt.Println(check, get+more, take, i, j, m, a, b,c,d)
			if take> get+more {
				take = get+more
				check = j+1
			}
		}
		fmt.Println(check)
	}
}

var sc = bufio.NewScanner(os.Stdin)

func scan_init() {
	sc.Split(bufio.ScanWords)
}
func scanInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func scan() string {
	sc.Scan()
	return sc.Text()
}

var rdr = bufio.NewReaderSize(os.Stdin, 200000)

func readLine() string {
	buf := make([]byte, 0, 200000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
func readLineToNumber() int {
	S := readLine()
	number, _ := strconv.Atoi(S)
	return number
}
func readLineToSlice() []string {
	S := readLine()
	list := strings.Split(S, "")
	return list
}
func readLineToNumberSlice(memo map[string]int) []int {
	// err時は-1を代入
	S := readLine()
	intList := make([]int, len(S))
	for i := 0; i < len(S); i++ {
		if val, ok := memo[string(S[i])]; ok {
			intList[i] = val
		} else {
			intList[i] = -1
		}
	}
	return intList
}