#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long long aux1, aux2;
  scanf("%d %d", &n, &m);
  pair<long long, long long> valsn[n];
  pair<long long, long long> valsm[m];
  for (int i = 0; i < n; i++) {
    scanf("%lld %lld", &aux1, &aux2);
    valsn[i] = make_pair(aux1, aux2);
  }
  for (int i = 0; i < m; i++) {
    scanf("%lld %lld", &aux1, &aux2);
    valsm[i] = make_pair(aux1, aux2);
  }
  for (int i = 0; i < n; i++) {
    pair<long long, long long> xy = valsn[i];
    long long distmin = 100000000000;
    pair<long long, long long> pdist;
    int res = -1;
    for (int j = 0; j < m; j++) {
      pair<long long, long long> xya = valsm[j];
      long long distaux =
          abs(xy.first - xya.first) + abs(xy.second - xya.second);
      if (distaux < distmin) {
        distmin = distaux;
        pdist = xya;
        res = j + 1;
      } else if (distaux == distmin) {
        if (!(pdist.first < xya.first || pdist.second < xya.second)) {
          pdist = xya;
          res = j + 1;
        }
      }
    }
    printf("%d\n", res);
  }
  return 0;
}
