import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);

void main()
{
    long n, m;
    scan(n, m);
    auto ab = new long[][](n, 2);
    auto cd = new long[][](m, 2);
    // writeln(ab);
    // writeln(cd);
    auto ans = new long(100);
    auto check_i = new long[](n);
    foreach (i; 0 .. n)
    {
        long a, b;
        scan(a, b);
        ab[i][0] = a;
        ab[i][1] = b;
    }
    // writeln(ab);
    foreach (i; 0 .. m)
    {
        long c, d;
        scan(c, d);
        cd[i][0] = c;
        cd[i][1] = d;
    }
    // writeln(cd);
    foreach (i; 0 .. n)
    {
        long ans_x = 10 ^^ 9;
        foreach (j; 0 .. m)
        {
            long tmp;
            tmp = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]);
            if (tmp < ans_x)
            {
                check_i[i] = j + 1;
                ans_x = tmp;
            }

        }
    }
    foreach (i; 0 .. n)
    {
        writeln(check_i[i]);
    }

}
//https://rclone.org/

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}
