#include <bits/stdc++.h>

using namespace std;

int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++){
    cin >> a[i] >> b[i];}
int c[m], d[m];
for(j=1; j<=m; j++){
    cin >> c[j] >> d[j];}

int min[n], number[n], k, l;
for(l=1; l<=n; l++){
    min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
    number[l] = 1;
    for(k=2; k<=m; k++){
        if(min > abs(a[l]-c[k])+abs(b[l]-d[k])){
            min = abs(a[l]-c[k])+abs(b[l]-d[k]);
            number[l] = k;
        }
    }
}

cout << number << endl;
return 0;
}
