#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int number_read = 0, if_ok_read = 1;
  char ch_read = getchar();
  while (ch_read < '0' || ch_read > '9') {
    if (ch_read == '-') if_ok_read = -1;
    ch_read = getchar();
  }
  while (ch_read >= '0' && ch_read <= '9') {
    number_read = number_read * 10 + ch_read - '0';
    ch_read = getchar();
  }
  return number_read * if_ok_read;
}
inline void write(int x_write) {
  if (x_write < 0) {
    putchar('-');
    x_write = -x_write;
  }
  if (x_write > 9) write(x_write / 10);
  putchar(x_write % 10 + '0');
  return;
}
int main() {
  int n = read(), m = read(), a[25], b[25], c[25], d[25];
  for (int i = 1; i <= n; i++) {
    a[i] = read();
    b[i] = read();
  }
  for (int i = 1; i <= m; i++) {
    c[i] = read();
    d[i] = read();
  }
  for (int i = 1; i <= n; i++) {
    int minn = 1000000000, k;
    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]);
        k = j;
      }
    write(k);
    putchar('\n');
  }
  return 0;
}
