using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
    public static void Main()
    {
        int[] n = Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
        int N = n[0];
        int M = n[1];

        int[,] st = new int[N, 2];
        for (int i = 0; i < N; i++)
        {
            n = Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
            st[i, 0] = n[0];
            st[i, 1] = n[1];
        }

        int[,] points = new int[M, 2];
        for (int i = 0; i < M; i++)
        {
            n = Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
            points[i, 0] = n[0];
            points[i, 1] = n[1];
        }

        int add = 0;
        int min = 10000000;
        int box = 0;
        for (int i = 0; i < N; i++)
        {
            min = 10000000;
            add = 0;
            for (int j = 0; j < M; j++)
            {
                box = Math.Abs(st[i, 0] - points[j, 0]) + Math.Abs(st[i, 1] - points[j, 1]);
                if (min > box) { min = box; add = j + 1; }
            }
            Console.WriteLine(add);
        }
    }
}