/**
 *      ABC 57 B
 *      author  : kyomukyomupurin
 *      created : 2018-09-06 02:26:06
**/

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int N, M; cin >> N >> M;
    int a[N] = {}; int b[N] = {}; int c[M] = {}; int d[N];

    for (int i = 0; i < N; ++i) {
        cin >> a[i] >> b[i];
    }
    for (int i = 0; i < M; ++i) {
        cin >> c[i] >> d[i];
    }
    int answer[N] = {};

    for (int i = 0; i < N; ++i) {
        int point;
        int min = 1000000000;
        for (int j = 0; j < M; ++j) {
            //int min = 1000000000;
            int x = abs(a[i] - c[j]) + abs(b[i] - d[j]);
            if (x < min){
                min = x;
                point = j;
            }
        }
        answer[i] = point;
    }

    for (int i = 0; i < N; ++i) {
        cout << answer[i] + 1 << endl;
    }

    return 0;

}