#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#define INF 2147483647
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int plus(int a){
  if(a<0)
    a=-a;
  return a;
}
int main(){
  int n,m;
  cin>>n>>m;
  vector<pair<int,int> >pii;
  for(int i=0;i<n;i++){
    int a,b;
    cin>>a>>b;
    pii.pb(mp(a,b));
  }
  vector<int>ans;
  for(int i=0;i<m;i++){
    int a,b;
    int min=INF;
    cin>>a>>b;
    int flag=-1;
    for(int j=0;j<pii.size();j++){
      int c=plus((a-pii[i].F));
      int d=plus((b-pii[i].S));
      if(min>c+d){
	min=c+d;
	flag=j+1;
      }
    }
    ans.pb(flag);
  }
  for(int i=0;i<ans.size();i++){
    cout<<ans[i]<<endl;
  }
  return 0;
}