package main

import (
	"fmt"
	"math"
)

type Pos struct {
	X int
	Y int
}

type Poses []Pos

func main() {
	var N, M, x, y int
	fmt.Scan(&N, &M)
	var ss, cs Poses
	for i := 0; i < N; i++ {
		fmt.Scan(&x, &y)
		ss = append(ss, Pos{X: x, Y: y})
	}
	for i := 0; i < N; i++ {
		fmt.Scan(&x, &y)
		cs = append(cs, Pos{X: x, Y: y})
	}
	for i := 0; i < len(ss); i++ {
		var p int
		m := math.MaxInt64
		for j := 0; j < len(cs); j++ {
			w := abs(ss[i].X-cs[j].X) + abs(ss[i].Y-cs[j].Y)
			if w < m {
				m = w
				p = j + 1
			}
		}
		fmt.Println(p)
	}
}
func abs(a int) int {
	return int(math.Abs(float64(a)))
}
