using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp7
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] param = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int studentNum = param[0];
            int checkPointNum = param[1];

            List<List<int>> student = new List<List<int>>();
            List<List<int>> checkPoint = new List<List<int>>();

            for (int index = 0; index< studentNum; index++)
            {
                student.Add( Console.ReadLine().Split(' ').Select(int.Parse).ToList());
            }

            for (int index = 0; index < studentNum; index++)
            {
                checkPoint.Add( Console.ReadLine().Split(' ').Select(int.Parse).ToList());
            }


            //search most near check point
            foreach (var s in student)
            {
                var distances =checkPoint.Select(v => Math.Abs(v[0]-s[0])+ Math.Abs(v[1] - s[1])).ToList();

                Console.WriteLine(distances.IndexOf(1+distances.Min()));


            }







        }
    }
}
