'use strict'

function main(s) {
  s = s.split('\n');

  const n = Number(s[0].split(' ')[0]);
  const m = Number(s[0].split(' ')[0]);

  const a = s.slice(1, 1 + n).map(n => n.split(' ').map(l => Number(l)));
  const c = s.slice(1 + n,-1).map(n => n.split(' ').map(l => Number(l)));

  const ans = [];

  for (let i = 0; i < n; i++) {
    let minDist = 4e8;
    let idx = 0;
    for (let j = 0; j < m; j++) {
      const dist = Math.abs(a[i][0] - c[j][0]) + Math.abs(a[i][1] - c[j][1]);
      if (dist < minDist) {
        minDist = dist;
        idx = j + 1;
      }
    }
    ans.push(idx);
  }

  console.log(ans.join('\n'));
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
