using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace AtCoder
{
	public class QuestionA
	{
		public static void Main(string[] args)
		{
			var nm = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
			int n = nm[0];
			int m = nm[1];

			var abArray = new (int a, int b)[n];
			var cdArray = new (int c, int d)[m];

			for (int i = 0; i < n; ++i) {
				var temp = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
				abArray[i] = (temp[0], temp[1]);
			}

			for (int i = 0; i < m; ++i) {
				var temp = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
				cdArray[i] = (temp[0], temp[1]);
			}

			List<int> resultIndex = new List<int>();
			Array.ForEach(abArray, ab => {
				int min = int.MaxValue;
				int index = 0;
				for (int i = 0; i < n; ++i) {
					var calc = Math.Abs(ab.a - cdArray[i].c) + Math.Abs(ab.b - cdArray[i].d);
					if(min > calc) {
						min = calc;
						index = i + 1;
					}
				}
				resultIndex.Add(index);
			});

			foreach(var index in resultIndex) {
				Console.WriteLine(index);
			}

		}
	}
}
