#include <iostream>
#include <vector>
using namespace std;

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> a(N, 0), b(N, 0), c(M, 0), d(M, 0);
    for (int i = 0; i != N; ++i) cin >> a[i] >> b[i];
    for (int i = 0; i != M; ++i) cin >> c[i] >> d[i];
    for (int n = 0; n != N; ++n){
        int dist = 1000000000;
        int ans = 0;
        for (int m = 0; m != M; ++m){
            int d = abs(a[n] - c[m]) + abs(b[n] - d[m]);
            if (d < dist) {
                dist = d;
                ans = m;
            }
        }
        cout << ans <<endl;
    }
    return 0;
}