import java.util.Scanner;

public class Main {

    public Main() {
    }

    private static Scanner sc;

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

    private void solve() {
        int N = sc.nextInt();
        int M = sc.nextInt();

        int[] a = new int[N];
        int[] b = new int[N];

        for (int i = 0; i < N; i++) {
            a[i] = sc.nextInt();
            b[i] = sc.nextInt();
        }

        int[] c = new int[M];
        int[] d = new int[M];

        for (int i = 0; i < M; i++) {
            c[i] = sc.nextInt();
            d[i] = sc.nextInt();
        }

        for (int i = 0; i < N; i++) {
            int x = a[i];
            int y = b[i];

            int ans = 0;
            int dist = Integer.MAX_VALUE;
            for (int j = 0; j < M; j++) {
                int tmp = Math.abs(x - c[j]) + Math.abs(y - d[j]);
                if (tmp < dist) {
                    ans = j + 1;
                    dist = tmp;
                }
            }
            System.out.println(ans);
        }
    }
}