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

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
    int n,n;
    cin >> n >> m;
    vector<pair<ll int, ll int>> seito,point;
    REP(i, n){
        ll int a,b;
        cin >> a >> b;
        seito.pb(mp(a,b));
    }
    REP(i,m){
        ll int c,d;
        cin >> c >> d;
        point.pb(mp(c,d));
    }
    REP(i,n){
        int ans = 0;
        int old = 0;
        REP(j,m){
            int dis = abs(seito[i].first - point[j].first) + abs(seito[i].second - point[j].second);
            if(j == 0){
                old = dis;
            } else{
                if(old > dis){
                    old = dis;
                    ans = j;
                }
            }
        }
        cout << ans+1 << endl;
    }
}
