#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
    int n,m;
    cin >> n >> m;
    vector<P> st(n);
    vector<P> ch(m);
    rep(i,n) cin >> st[i].first >> st[i].second;
    rep(i,m) cin >> ch[i].first >> ch[i].second;
    vector<int> ans(n);
    rep(i,n) {
        int dis = 1001001001;
        int num;
        rep(j,m) {
            int ndis = abs(st[i].first-ch[j].first)+abs(st[i].second-ch[j].second);
            if(ndis < dis) num = j;
            dis = min(ndis,dis);
        }
        ans[i] = num+1;
    }
    rep(i,n) cin >> ans[i] >> endl;
}