signed main()
{
    //入力の高速化用のコード
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);

    ll n, m;
    cin >> n >> m;
    ll a[n], b[n], c[m], d[m];
    rep(i, n)
    {
        cin >> a[i] >> b[i];
    }
    rep(i, m)
    {
        cin >> c[i] >> d[i];
    }
    ll dif_min;
    ll count;
    rep(i, n)
    {
        dif_min = MOD;
        count=-1;
        rep(j, m)
        {
            if (dif_min > abs(a[i] - c[j]) + abs(b[i] - d[j]))
            {
                count = j + 1;
                dif_min =abs(a[i] - c[j]) + abs(b[i] - d[j]);
            }
        }
        cout << count << endl;
    }
    return 0;
}