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

namespace ConsoleApp52
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int N = int.Parse(input[0]);
            int M = int.Parse(input[1]);

            int[] a = new int[N];
            int[] b = new int[N];

            for (int i = 0; i < N; i++)
            {
                string[] Input = Console.ReadLine().Split(' ');
                a[i] = int.Parse(Input[0]);
                b[i] = int.Parse(Input[1]);
            }

            int[] c = new int[M];
            int[] d = new int[M];
            for (int i = 1; i < M; i++)
            {
                string[] Input = Console.ReadLine().Split(' ');
                c[i] = int.Parse(Input[0]);
                d[i] = int.Parse(Input[1]);
            }


            for (int i = 0; i < N; i++)
            {

                int distance = int.MaxValue;
                int checkpoint = 0;
                for (int h = 0; h < M; h++)
                {    
                     int Distance = System.Math.Abs(a[i] - c[h]) + System.Math.Abs(b[i] - d[h]);

                     if (distance > Distance)
                     {
                            distance =Distance;
                            checkpoint = h;
                           
                     }
                }
                Console.WriteLine(checkpoint + 1);
               
            }
        }
    }
}
