#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define MAX_N 60
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
pii students[MAX_N];
pii checkP[MAX_N];
int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n,m;
    cin >> n >> m;
    for (int i = 0;i < n;i++){
        cin >> students[i].F >> students[i].S;
    }
    for (int i= 0;i < m;i++){
        cin >> checkP[i].F >> checkP[i].S;

    }
    int cdist;
    for (int i= 0;i < n;i++){
        int mindist = 1e9,minin = -1;
        for (int j = 0;j < m;j++){
            cdist = (abs(students[i].F - checkP[i].F)) + (abs(students[i].A - checkP[i].S));
            if (cdist < mindist){
                mindist = cdist;
                minin = j;
            }
        }
        cout << minin + 1 << endl;
    }
    return 0;
}
