#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  return x *= f;
}
inline void write(int x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
const int maxn = 1 << 25;
int main() {
  register int n, m, a[61], b[61], x[61], y[61];
  n = read(), m = read();
  for (int i = (1); i <= (n); ++i) a[i] = read(), b[i] = read();
  for (int i = (1); i <= (m); ++i) x[i] = read(), y[i] = read();
  for (int i = (1); i <= (n); ++i) {
    int ans = maxn, t;
    for (int j = (1); j <= (m); ++j) {
      int tmp = abs(b[i] - y[j]) + abs(a[i] - x[j]);
      if (ans > tmp) {
        ans = tmp;
        t = j;
      }
    }
    cout << t << endl;
  }
  return 0;
}
