#include <bits/stdc++.h>
const long long oo = 2 * 1000 * 1000 * 1000;
const int _cnt = 1000 * 1000;
const int _p = 1000 * 1000 * 1000 + 7;
long long o(long long x) { return x % _p; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
using namespace std;
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
struct point {
  long long x, y;
};
long long dist(point p, point q) {
  return (long long)abs(p.x - q.x) + (long long)abs(p.y - q.y);
}
int n, m, ans[100005];
point p[55], q[55];
long long minnum = oo * oo;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%I64d%I64d", &p[i].x, &p[i].y);
  for (int i = 1; i <= m; i++) scanf("%I64d%I64d", &q[i].x, &q[i].y);
  for (int i = 1; i <= n; i++) {
    minnum = oo * oo;
    for (int j = 1; j <= m; j++) {
      if (dist(p[i], q[j]) >= minnum) continue;
      minnum = dist(p[i], q[j]);
      ans[i] = j;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d\n", ans[i]);
  return 0;
}
