import java.util.Scanner;

public class Main {
	void run() {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[m];
		int[] d = new int[m];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
		}
		for (int i = 0; i < m; i++) {
			c[i] = sc.nextInt();
			d[i] = sc.nextInt();
		}

		int sum = 0;
		for (int i = 0; i < n; i++) {
			int minIndex = 0;
			for (int j = 0; j < m; j++) {
				int tmp1 = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				int tmp2 = Math.abs(a[i] - c[minIndex]) + Math.abs(b[i] - d[minIndex]);
				if (tmp1 < tmp2) {
					minIndex = j;
				}
			}
			System.out.println(++minIndex);
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}
}
