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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            var x = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int N = x[0];
            int M = x[1];
            var out1 = new int[N];
            var A = new int[N][];
            for (var i = 0; i < N; i++) A[i] = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var C = new int[M][];
            for (var i = 0; i < M; i++) C[i] = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            for (int i = 0; i < N; i++)
            {
                int l = 99999999;
                for (int j = 0; j < M; j++)
                {
                    if (D(A[i], C[j]) < l)
                    {
                        l = D(A[i], C[j]);
                        out1[i] = j + 1;
                    }
                }
                Console.WriteLine(out1[i]);
            }
        }

        static int D(int[] a, int[] b)
        {
            return Math.Abs(a[0] - b[0]) + Math.Abs(a[1] - b[1]);
        }
    }
}