#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define cy cout << "Yes" << endl
#define cn cout << "No" << endl
typedef long long ll;

void Main()
{
	ll N, M;
  	cin >> N >> M;
  	vector<ll> a(N), b(N);
	rep(i,N){
    	cin >> a[i] >> b[i];
    }
  	vector<ll> c(M), d(M);
	rep(i,M){
    	cin >> c[i] >> d[i];
    }

  	auto distance = [&](ll x1, ll y1, ll x2, ll y2){
	 	ll ans = abs(x1-x2)+abs(y1-y2);   	
		return ans;    
    }
  	  
	ll tempmax = 0;
  	rep(i,N){
		rep(j,M){
      		tempmax = max(tempmax, distance(a[i],b[i],c[j],d[j]));
        }
    	cout << tempmax << endl;
    }  
  
    return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}