#include <bits/stdc++.h>
using namespace std;
const int maxn = 50 + 10;
const long long INF = 200000001;
int n, m;
int vis[maxn];
typedef struct {
  long long x, y;
} point;
typedef struct {
  long long x, y;
  int num;
} fun;
point p[maxn];
fun s[maxn];
int main() {
  while (cin >> n >> m) {
    memset(vis, 0, sizeof(vis));
    for (int i = 1; i <= n; i++) scanf("%lld%lld", &p[i].x, &p[i].y);
    for (int i = 1; i <= m; i++) {
      scanf("%lld%lld", &s[i].x, &s[i].y);
      s[i].num = i;
    }
    for (int i = 1; i <= n; i++) {
      long long minx = INF;
      int k = 0;
      for (int j = 1; j <= m; j++) {
        long long t = abs(p[i].x - s[j].x) + abs(p[i].y - s[j].y);
        if (t < minx) {
          minx = t;
          k = j;
        }
      }
      printf("%d\n", k);
    }
  }
  return 0;
}
