using System;

namespace ABC057_B
{
    class Program
    {
        static void Main(string[] args)
        {
            var sss = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            var N = sss[0];
            var M = sss[1];
            var x = new int[N];
            var y = new int[N];
            var px = new int[M];
            var py = new int[M];
            var ans = new int[N];
            for (var i = 0; i < N; i++)
            {
                var xy = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
                x[i] = xy[0];
                y[i] = xy[1];
            }
            for (var i = 0; i < M; i++)
            {
                var point = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
                px[i] = point[0];
                py[i] = point[1];
            }
            for (var i = 0; i < N; i++)
            {
                var min = 30000000;
                for (var j = M - 1; j >= 0; j--)
                {
                    var dist = Math.Abs(x[i] - px[j]) + Math.Abs(y[i] - py[j]);
                    if (dist <= min)
                    {
                        min = dist;
                        ans[i] = j + 1;
                    }
                }
            }
            foreach (var ch in ans)
            {
                Console.WriteLine(ch);
            }
        }
    }
}
