import java.util.*;

public class Main {    
    public static void main(String[] args){        
           
       Scanner sc = new Scanner(System.in);

       int N = sc.nextInt();
       int M = sc.nextInt();
       
       int a[] = new int[N];
       int b[] = new int[N];
       
       int c[] = new int[M];
       int d[] = new int[M];
       
       for(int i =0;i < N;i++){
           a[i] = sc.nextInt();
           b[i] = sc.nextInt();
       }
       
       for(int j = 0;j < M;j++){
           c[j] = sc.nextInt();
           d[j] = sc.nextInt();
       }
       
       
       int ans[] = new int[N];

       for(int i = 0;i < N;i++){
          int min = Integer.MAX_VALUE;
          int cur = 50;
          for(int k = 0;k < M;k++){
              int dist = Math.abs(a[i] - c[k]) + Math.abs(b[i] - d[k]);
              if(dist < min) cur = k;
              if(dist == min) cur = Math.min(cur,k);
              min = Math.min(min,dist);
          }                  
          System.out.println(cur + 1);
       }                     
       
    }            
}
        