#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i <(n); i++)
using namespace std;
using ll = long long;

int main()
{
    int n, m;
    cin << n << m;
    int students[n][2];
    int points[m][2];

    rep(i, n)
        cin >> students[i][0] >> students[i][1];
    rep(j, m)
        cin >> points[j][0] >> points[j][1];
    
    rep(i, n)
    {
        int p;
        int best_d = 1000000000;
        rep(j,m)
        {
            int d = abs(students[i][0] - points[j][0]) + abs(students[i][1] - points[j][1]);
            if (d < best_d)
            {
                p = j;
                best_d = d;
            }
        }
        p++;
        cout << p << endl;
    }
    return 0;
}