#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    ll n,m;
    cin>>n>>m;
    vector<ll> a(n),b(n),c(m),d(m),ans(n,-1);
    rep(i,n) cin>>a[i]>>b[i];
    rep(i,m) cin>>c[i]>>d[i];
    rep(i,n){
        ll mn=1e9;
        rep(j,m){
            ll manh=abs(a[i]-c[j])+abs(b[i]-d[j]);
            if(mn>manh){
                mn=manh;
                ans[i]=j+1;
            }
        }
    }
    rep(i,n) cout<<a<<endl;
    return 0;
}