#! usr/bin/perl

use strict;
use warnings;

my @a;
my @b;
my @c;
my @d;

sub get_pos{
    my ($count,$x,$y) = @_;
    foreach my $i (0..$count-1){
        chomp(my $line = <STDIN>);
        (@$x[$i],@$y[$i]) = split ' ',$line;
    }
}

chomp(my $line = <STDIN>);
my ($N,$M) = split ' ',$line;
&get_pos($N,\@a,\@b);
&get_pos($M,\@c,\@d);

foreach my $student (0..$N-1){
    my $p = 0;
    my $min_dis = 300;
    foreach my $checkP (reverse 0..$M-1){
        my $d = abs($a[$student]-$c[$checkP]) + abs($b[$student]-$d[$checkP]);
        unless ($d > $min_dis) {$min_dis = $d; $p = $checkP+1;}
    }
    print "$p\n";
}
