inp = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')
l = inp.shift().split(' ')
N = l[0] * 1
M = l[1] * 1 
s = []
c = []
for (i=0; i<N; i++) {
  s[i] = inp[i].split(' ')
}
for (i=N; i<N+M; i++) {
  c[i-N] = inp[i].split(' ')
}
for (i=0; i<N; i++) {
  min = 100000001
  for (j=0; j<M; j++) {
    x = s[i][0] * 1
    y = s[i][1] * 1
    m = Math.abs(c[j][0] - x) + Math.abs(c[j][1] - y)
    if (min > m) {
      min = m
      n = j + 1
    }
  }
  console.log(n)
}
