#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  pair<long long, long long> students[55];
  pair<long long, long long> checkpoints[55];
  for (int i = 0; i < n; i++)
    scanf("%lld%lld", &students[i].first, &students[i].second);
  for (int i = 0; i < m; i++)
    scanf("%lld%lld", &checkpoints[i].first, &checkpoints[i].second);
  for (int i = 0; i < n; i++) {
    long long min = 1e8, index = 0;
    for (int j = 0; j < m; j++) {
      if (abs(students[i].first - checkpoints[j].first) +
              abs(students[i].second - checkpoints[j].second) <
          min) {
        min = abs(students[i].first - checkpoints[j].first) +
              abs(students[i].second - checkpoints[j].second);
        index = j + 1;
      }
    }
    printf("%lld\n", index);
  }
}
