using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Program
    {
        static void Main(string[] args)
        {
            int[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int[,] b = new int[2, a[0]];
            for (int i = 0; i < a[0]; i++) {
                int[] c = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
                b[0, i] = c[0];
                b[1, i] = c[1];
            }
            int[,] d = new int[2, a[1]];
            for (int i = 0; i < a[1]; i++) {
                int[] c = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
                d[0, i] = c[0];
                d[1, i] = c[1];

            }
            Console.WriteLine(String.Join("", new Calu().calu(a, b, d).Reverse()));
            
        }
        
        public class Calu{
            public string calu(int[] a, int[,] b, int[,] d){
                StringBuilder s = new StringBuilder();
                for (int i = 0; i < a[0]; i++)
                {
                    int index = int.MinValue;
                    int min = int.MaxValue;
                    for (int j = 0; j < a[1]; j++) 
                    {                                                                                     
                        if (min > Math.Min(min, Math.Abs(b[0, i] - d[0, j]) + Math.Abs(b[1, i] - d[1, j])))
                        {
                            min = Math.Min(min, Math.Abs(b[0, i] - d[0, j]) + Math.Abs(b[1, i] - d[1, j]));
                            index = j + 1;
                        }
                    }
                    s.Insert(0, index.ToString());
                    s.Insert(0, '\n');
                }                 
                return s.ToString();
            }
        }
    }