function Main(input) {
  input = input.split("\n");
  var n = parseInt(input[0].split(" ")[0], 10);
  var m = parseInt(input[0].split(" ")[1], 10);
  var a = new Array(n);
  var b = new Array(n);
  var c = new Array(m);
  var d = new Array(m);
  var x = new Array(m);
  var s = new Array(n);
  var s1;
  for (i=0; i<n; i++){
    a[i]=parseInt(input[i+1].split(" ")[0], 10);
    b[i]=parseInt(input[i+1].split(" ")[1], 10);
    for(j=0; j<m; j++){
      c[j]=parseInt(input[j+n+1].split(" ")[0],10);
      d[j]=parseInt(input[j+n+1].split(" ")[1],10);
      x[j]=Math.abs(a[i]-c[j])+Math.abs(b[i]-d[j]);
      if(j==0){
        x[i]=x[j];
        s[i]=j+1;
      }else{
        if(x[j]<x[i]){
          x[i]=x[j];
          s[i]=j+1;
        }
      }
    }
  }
  for(i=0; i<n; i++){
    if(i==0){
      s1=s[i];
    }else{
      s1=s1+"\n"+s[i];
    }
  }
    console.log('%s', s1);
  }
  Main(require("fs").readFileSync("/dev/stdin", "utf8"));