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

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    vector<int> b(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a.at(i) >> b.at(i);
    }
    vector<int> c(m);
    vector<int> d(m);
    for (int i = 0; i < m; i++)
    {
        cin >> c.at(i) >> d.at(i);
    }
    int miti;
    int hozon;
    int xxx;
    for(int i=0;i<n;i++){
        hozon=abs(a.at(0)-c.at(0))+abs(b.at(0)-d.at(0));;
        xxx=0;
        for(int j=0;j<m;j++){
            miti=abs(a.at(i)-c.at(j))+abs(b.at(i)-d.at(j));
            if(hozon<=miti){
                continue;
            }
            else{
                hozon=miti;
                xxx=j;
            }
        }
        cout<<xxx+1<<endl;

}
