//shakyo
using System;
using System.Collections.Generic;
using System.Linq;
public class Hello{
    public static void Main(){
        var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var N = input[0];
        var M = input[1];
        
        var A = new int[N];
        var B = new int[N];
        var C = new int[M];
        var D = new int[M];
        
        for(var i = 0;i < N;i++){
            var a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            A[i] = a[0];
            B[i] = a[1];
        }
        for(var j = 0;j < M;j++){
            var b = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            C[j] = b[0];
            D[j] = b[1];
        }
        
        for(var n = 0;n < N;n++){
            var cp = 1;
            var minDist = Math.Abs(A[n] - C[0]) + Math.Abs(B[n] - D[0]);
            for(var m = 1;m < M;m++){
                var curdist = Math.Abs(A[n] - C[m]) + Math.Abs(B[n] - C[m]);
                if(curdist < minDist){
                    minDist = curdist;
                    cp = m + 1;
                }
            }
            Console.WriteLine(cp);
        }
        
    }
}
