#include <bits/stdc++.h>
using namespace std;
int a[55], b[55], c[55], d[55];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d %d", &a[i], &b[i]);
  for (int i = 1; i <= m; i++) scanf("%d %d", &c[i], &d[i]);
  for (int i = 1; i <= n; i++) {
    int minn = 99999999, mini;
    for (int j = 1; j <= m; j++) {
      if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < minn) {
        minn = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        mini = j;
      }
    }
    printf("%d\n", mini);
  }
  return 0;
}
