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

int main()
{
    int n, m;
    cin >> n >> m;
    int64_t a[n], b[n], c[m], d[m];
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }
    for (int i = 0; i < m; i++) {
        cin >> c[i] >> d[i];
    }

    int64_t min_j = 0;
    for (int i = 0; i < n; i++) {
        int min = 4e8q2 + 1;
        for (int j = 0; j < m; j++) {
            if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
                min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
                min_j = j + 1;
            }
        }
        cout << min_j << endl;
    }
}