import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		ArrayList<Integer> listA = new ArrayList<>();
		ArrayList<Integer> listB = new ArrayList<>();
		ArrayList<Integer> listC = new ArrayList<>();
		ArrayList<Integer> listD = new ArrayList<>();

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		for (int i = 0; i < n; i++) {
			listA.add(scan.nextInt());
			listB.add(scan.nextInt());
		}
		for (int i = 0; i < m; i++) {
			listC.add(scan.nextInt());
			listD.add(scan.nextInt());
		}
		for (int i = 0; i < n; i++) {
			int min = Integer.MAX_VALUE;
			int ans = 0;
			int a = listA.get(i);
			int b = listB.get(i);
			for (int j = 0; j < m; j++) {
				int temp = Math.abs(a - listC.get(j)) + Math.abs(b - listD.get(j));
				if (temp < min) {
					min = temp;
					ans = j + 1;
				}
			}
			System.out.println(ans);
		}
	}
}