'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 < a.length; i++) {
    const distList = [];
    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]);
      distList.push({point: j + 1, dist: dist});
    }
    distList.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;
    });
    ans.push(distList[0].point);
  }

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

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