var Point = (function () {
  function Point(input) {
    this.x = Number(input[0]);
    this.y = Number(input[1]);
  }
  Point.prototype.getMinManhattanDistance = function(points) {
    var _this = this;
    var minDistance;
    var mostMinIndex = 0;
    points.forEach(function(p, i) {
      var d = Math.abs(_this.x - p.x) + Math.abs(_this.y - p.y);
      if (minDistance === undefined || minDistance > d) {
        mostMinIndex = i;
        minDistance = d;
      }
    });
    return mostMinIndex + 1;
  };
  return Point;
}());

function main(input) {
  var lines = input.split("\n");
  var peopleCount = Number(lines[0].split(" ")[0]);
  var checkPointCount = Number(lines[0].split(" ")[1]);

  var students = [];
  for (var i = 1; i < peopleCount + 1; i++){
    students.push(new Point(lines[i].split(" ")));
  }

  var checkPoints = [];
  for (var i = 1 + peopleCount; i < peopleCount + checkPointCount + 1; i++){
    checkPoints.push(new Point(lines[i].split(" ")));
  }

  students.forEach(function(s) {
    console.log(s.getMinManhattanDistance(checkPoints));
  });
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
