#include<bits/stdc++.h>

#define REPI(i, n) for(int i = 0; i < n; i++)
#define REPJ(j, n) for(int j = 0; j < n; j++)

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, m; cin >> n >> m;
    int a[n], b[n], minimum[n], ans[n], x[m], y[m];
    REPI(i, n){
        cin >> a[i] >> b[i];
        ans[i] = 0;
        minimum[i] = 2 * 100000000;
    }
    REPI(i, m){
        cin >> x[i] >> y[i];
    }

    REPI(i, n){
        REPJ(j, m){
            int man_dis = abs(a[i] - x[j]) + abs(b[i] - y[j]);
