#include <bits/stdc++.h>
using namespace std;
inline int readInt() {
  int s = 0, c, w = 1;
  while (!isdigit(c = getchar())) {
    if (c == '-') {
      w = -1;
    }
  }
  do s = s * 10 + c - '0';
  while (isdigit(c = getchar()));
  return s * w;
}
int n = readInt(), m = readInt();
int x1[55] = {0}, y11[55] = {0};
int x2[55] = {0}, y2[55] = {0};
int minn = 233333333, ans;
int main() {
  for (int i = 1; i <= n; ++i) {
    x1[i] = readInt();
    y11[i] = readInt();
  }
  for (int i = 1; i <= m; ++i) {
    x2[i] = readInt();
    y2[i] = readInt();
  }
  for (int i = 1; i <= n; ++i) {
    minn = 2333333333;
    for (int j = 1; j <= m; ++j) {
      int t = abs(x1[i] - x2[j]) + abs(y11[i] - y2[j]);
      if (t < minn) {
        minn = t;
        ans = j;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
