#include <bits/stdc++.h>
using namespace std;
long long N, M, tmp = 114514, ans;
int main() {
  cin >> N >> M;
  pair<long, long long> a[55];
  pair<long long, long long> c[55];
  for (long long i = 0; i < N; i++) {
    cin >> a[i].first >> a[i].second;
  }
  for (long long i = 1; i <= M; i++) {
    cin >> c[i].first >> c[i].second;
  }
  for (long long i = 0; i < N; i++) {
    ans = 0;
    tmp = 114514;
    for (long long j = 1; j <= M; j++) {
      long long dis =
          abs(c[j].first - a[i].first) + abs(c[j].second - a[i].second);
      if (tmp > dis) {
        ans = j;
      }
      tmp = min(tmp, dis);
    }
    cout << ans << endl;
  }
  return 0;
}
