import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            new Main().solve(in);
        }
    }

    private void solve(Scanner in) {
        int N = in.nextInt(), M = in.nextInt();
        int[] a = new int[N], b = new int[N], c = new int[M], d = new int[M];
        for (int i = 0; i < N; i++) {
            a[i] = in.nextInt();
            b[i] = in.nextInt();
        }
        for (int i = 0; i < M; i++) {
            c[i] = in.nextInt();
            d[i] = in.nextInt();
        }
        for (int i = 0; i < N; i++) {
            int ans = 0;
            int min = Integer.MAX_VALUE;
            for (int j = 0; j < M; j++) {
                int dist = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
                if (min > dist) {
                    ans = j;
                    min = dist;
                }
            }
            System.out.println(ans + 1);
        }
    }
}