open System
open System.IO

let readInt () = int (Console.ReadLine())
let readInts () = (Console.ReadLine().Split(' ')) |> (Array.map int)

let read2Ints () = 
    let t = readInts()
    (t.[0], t.[1]) 
let read3Ints () = 
    let t = readInts()
    (t.[0], t.[1], t.[2]) 

let inf = 1000000000

let manhattan (x, y) (z, w) = abs(x-z) + abs(y-w)
  


[<EntryPoint>]
let main args = 
    let n,m = read2Ints()
    let s = [|for i in 1..n -> read2Ints() |]
    let p = [|for i in 1..m -> read2Ints() |]

    for i=1 to n do
        let mutable a=inf
        let mutable b=0
        for j=1 to m do
            let t = manhattan s.[i-1] p.[j-1]
            if a > t then
                a <- t
                b <- j
        done
        printfn "%d" b
    done
    0

