#include <bits/stdc++.h>
using namespace std;

inline cal(int a,int b,int c,int d){
    return abs(a-c) + abs(b-d);
}

int main()
{
    int n,m,x,y;
    cin >> n >> m;
    vector < pair < int , int > > st;
    vector < pair < int , int > > chk;
    for(int i=0;i<n;i++){
        cin >> x >> y;
        st.push_back(make_pair(x,y));
    }
    for(int j=0;j<m;j++){
        cin >> x >> y;
        chk.push_back(make_pair(x,y));
    }
    for(int i=0;i<n;i++){
        int res = INT_MAX,idx = m;
        for(int j=m-1;j>=0;j--){
            int temp = cal(st[i].first,st[i].second,chk[j].first,chk[j].second);
            if(res >= temp){
                res = temp;
                idx = j;
            }
        }
        cout << idx+1 << endl;
    }
    return 0;
}
