#include<iostream>
#include<math.h>
using namespace std;

int main(){
  int N,M,i,j;
  cin >> N,M;
  cout << abs(N) < endl;
  int a[N],b[N],c[M],d[M];
  for(i=0;i<N;i++){
    cin >> a[i] >>b[i];
  }
  for(j=0;j<M;j++){
    cin >> c[j] >>d[j];
  }
  for(i=0; i < N;i++){
    int temp=0;
    for(j=0;j<M;j++){
      if(abs(a[i]-c[j]) + abs(b[i]-d[j]) < abs(a[i]-c[temp]) + abs(b[i]-d[temp])){
	  temp = j;
      }
    }
    cout << temp << endl;
  }
  return 0;
}
      