#include<bits/stdc++.h>
using namespace std;
int n, m;
int main(){
  cin >> n >> m;
  const int nm = 50;
  int a[nm], b[nm], c[nm], d[nm];
  for(int i = 0; i < n; i++) cin >> a >> b;
  for(int i = 0; i < m; i++) cin >> c >> d;
  
  for(int i = 0; i < n; i++){
    int minone = abs(a[i] - c[0]) + abs(b[i] - d[i]);
    for(int j = i; j < n; j++){
      int mintwo = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if(mintwo < minone) minone = mintwo;
    }
    cout << minone << endl;
  }
}