using System;
using System.Linq;

namespace _057
{
    class Program
    {
        static void Main(string[] args)
        {
            // B - Checkpoints
            var line = Console.ReadLine().Split(' ').Select(x=>int.Parse(x)).ToArray();
            var n = line[0];
            var m = line[1];

            var ab = new long[n,2];
            var cd = new long[m,2];
            var ans = new int[n];
            for (int i = 0; i < n; i++)
            {
                var line2 = Console.ReadLine().Split(' ').Select(x=>long.Parse(x)).ToArray();
                ab[i,0] = line2[0];
                ab[i,1] = line2[1];
            }
            for (int i = 0; i < m; i++)
            {
                var line2 = Console.ReadLine().Split(' ').Select(x=>long.Parse(x)).ToArray();
                cd[i,0] = line2[0];
                cd[i,1] = line2[1];
            }

            for (int i = 0; i < n; i++)
            {
                long min = 100000000;
                for (int j = 0; j < m; j++)
                {
                    var w = Math.Abs(ab[i,0]-cd[j,0])+Math.Abs(ab[i,1]-cd[j,1]);
                    if(w < min)
                    {
                        min = w;
                        ans[i] = j;
                    }
                }
            }

            for (int i = 0; i < n; i++)
            {
                Console.WriteLine(ans[i] + 1);
            }
        }
    }
}
