#include <stdio.h>                                                                          
#include <stdlib.h>                                                                     
#include <string.h>                                                                     
#include <limits.h>                                                                     
                                                                                        
int main(void)                                                                          
{                                                                                       
        int num, point, i, j, near_point;                                               
        long long **man_list, **point_list, tmp, near;                                  
                                                                                        
        scanf("%d %d", &num, &point);                                                   
        man_list = calloc(sizeof(long long *), num);                                    
        point_list = calloc(sizeof(long long *), num);                                  
                                                                                        
        for (i = 0; i < num; i++) {                                                     
                man_list[i] = calloc(sizeof(int), 2);                                   
                scanf("%lld %lld", &man_list[i][0], &man_list[i][1]);                   
        }                                                                               
        for (i = 0; i < point; i++) {                                                   
                point_list[i] = calloc(sizeof(int), 2);                                 
                scanf("%lld %lld", &point_list[i][0], &point_list[i][1]);               
        }                                                                               
                                                                                        
        for (i = 0; i < num; i++) {                                                     
                near = 1000000000;                                                      
                for (j = 0; j < point; j++) {                                           
                        tmp = abs((man_list[i][0]) - (point_list[j][0])) + abs((man_list[i][1]) - (point_list[j][1]));                                                          
                        if (tmp < near) {                                               
                                near = tmp;                                             
                                near_point = j + 1;                                      
                        }                                                                
                }                                                                        
                printf("%d\n", near_point);                                              
        }                                                                                
        return 0;                                                                        
}