#include <bits/stdc++.h>
using namespace std;
long long dist(long long x1, long long y1, long long x2, long long y2) {
  long long dist = 0;
  if (x1 > x2)
    dist += x1 - x2;
  else
    dist += x2 - x1;
  if (y1 > y2)
    dist += y1 - y2;
  else
    dist += y2 - y1;
  return dist;
}
int main() {
  int N, M;
  cin >> N >> M;
  long long a[N], b[N], c[M], d[M];
  for (int(i) = 0; (i) < (N); ++(i)) {
    cin >> a[i] >> b[i];
  }
  for (int(i) = 0; (i) < (M); ++(i)) {
    cin >> c[i] >> d[i];
  }
  long long max = 100000000;
  for (int(i) = 0; (i) < (N); ++(i)) {
    long long min = max;
    int min_index;
    for (int(j) = 0; (j) < (M); ++(j)) {
      long long distance = dist(a[i], b[i], c[j], d[j]);
      if (distance < min) {
        min = distance;
        min_index = j + 1;
      }
    }
    cout << min_index << endl;
  }
}
