#include <bits/stdc++.h>
#include <iomanip>

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef long double LD;
typedef pair<LD, LD> PLDLD;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
#define ALL(a) a.begin(),a.end()

LL INF=1e15+7;

int main()
{
    int n,m;
    cin>>n>>m;
    vector<PLL> p(n),q(m);
    REP(i,n)
    {
        LL a,b;
        cin>>a>>b;
        p[i]=PLL(a,b);
    }
    REP(i,m)
    {
        LL a,b;
        cin>>a>>b;
        q[i]=PLL(a,b);
    }

    REP(i,n)
    {
        int ans=0;
        LL mdis=INF,dis;
        REP(j,m)
        {
            dis=abs(p[i].first-q[j].first) + abs(p[i].second - q[j].second);
            if(dis<mdis)
            {
                mdis=dis;
                ans=j;
            }
        }
        cout<<ans+1<<endl;

    }*/
}

