using System;

public class P
{
    public int x { get; set; }
    public int y { get; set; }
}

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var m = int.Parse(line[1]);
        var std = new P[n];
        var cp = new P[m];
        for (int i = 0; i < n; i++)
        {
            line = Console.ReadLine().Trim().Split(' ');
            var a = int.Parse(line[0]);
            var b = int.Parse(line[1]);
            std[i] = new P { x = a, y = b };
        }
        for (int i = 0; i < n; i++)
        {
            line = Console.ReadLine().Trim().Split(' ');
            var c = int.Parse(line[0]);
            var d = int.Parse(line[1]);
            cp[i] = new P { x = c, y = d };
        }
        for (int i = 0; i < n; i++)
            Console.WriteLine(getCp(cp, std[i]) + 1);
    }
    public static int getCp(P[] cp, P a)
    {
        var ret = 999999999; var reti = -1;
        for (int i = 0; i < cp.Length; i++)
        {
            var w = Math.Abs(a.x - cp[i].x) + Math.Abs(a.y - cp[i].y);
            if (w < ret) { ret = w; reti = i; }
        }
        return reti;
    }
}