"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");

    const N = ~~(arg[0].split(" ")[0]);
    const M = ~~(arg[0].split(" ")[0]);
    
    const A = arg.slice(1, 1 + N).map(n => n.split(' ').map(l => ~~l));
    const C = arg.slice(1 + N,-1).map(n => n.split(' ').map(l => ~~l));
    
    const answer = [];
    
    for (let i = 0; i < A.length; i++) {
        const list = [];
        
        for (let j = 0; j < C.length; j++) {
            const dist = Math.abs(A[i][0] - C[j][0]) + Math.abs(A[i][1] - C[j][1]);
            list.push({point: j + 1, dist: dist});
        }
    
        list.sort((a, b) => {
            if (a.dist < b.dist) return -1;
            if (a.dist > b.dist) return 1;
            if (a.point < b.point) return -1;
            if (a.point > b.point) return 1;
            return 0;
        });
        
        answer.push(list[0].point);
    }
    
    console.log(answer.join("\n"));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));