#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define ll int64_t
using namespace std;

bool compare_by_b(pair<string,int> a,pair<string,int> b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

int main(){
    ll n,m,mini=10000000,number = 0;
    cin>>n>>m;
    vector<pair<ll,ll>> s(n);
    rep(i,n) cin>>s[i].first>>s[i].second;
    vector<pair<ll,ll>> d(m);
    rep(i,m) cin>>d[i].first>>d[i].second;
    vector<int> p;
    
    rep(i,n){
        rep(j,m){
            if(abs(s[i].first-d[j].first)+abs(s[i].second-d[j].second)<mini) {
                mini = abs(s[i].first-d[j].first)+abs(s[i].second-d[j].second);
                number = j+1;
            }
        }
        cout<<number<<endl;
        number = 0;
        mini = 10000000;
    }