#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int64_t minn(int64_t a,int64_t b){
    if(a >= b) return b;
    else return a;
}
int main(){
    int N,M;
    cin >> N>>M;
    vector<int64_t> A(N);
    vector<int64_t> B(N);
    vector<int64_t> C(M);
    vector<int64_t> D(M);
    for(int i = 0;i < N;i++){
        cin >> A[i] >> B[i];
    }
    for(int i = 0;i < M ;i++){
        cin >> C[i] >> D[i];
    }
    for(int i = 0;i < N;i++){
        int ans = 12345678; int num = 0;
        for(int j = 0;j < M;j++){
            if(ans > abs(A[i] - C[j]) + abs(B[i] - D[j])){
            ans = abs(A[i] - C[j]) + abs(B[i] - D[j]);
            num = j + 1;
            }
        }
        cout << num << endl;
    }
}

}