package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextIntSlice(size int) []int {
	re := make([]int, size)
	for i := 0; i < size; i++ {
		re[i] = nextInt()
	}
	return re
}

func max(a []int) int {
	max := a[0]
	for _, v := range a {
		if v > max {
			max = v
		}
	}
	return max
}

func min(a []int) int {
	min := a[0]
	for _, v := range a {
		if v < min {
			min = v
		}
	}
	return min
}

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

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

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