#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int getint() {
  unsigned int c;
  int x = 0;
  while (((c = getchar()) - '0') >= 10) {
    if (c == '-') return -getint();
    if (!~c) exit(0);
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while (((c = getchar()) - '0') < 10);
  return x;
}
int getstr(char *s) {
  int c, n = 0;
  while ((c = getchar()) <= ' ') {
    if (!~c) exit(0);
  }
  do {
    s[n++] = c;
  } while ((c = getchar()) > ' ');
  s[n] = 0;
  return n;
}
template <class T>
inline bool chmin(T &a, T b) {
  return a > b ? a = b, 1 : 0;
}
template <class T>
inline bool chmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
int as[111], bs[111], cs[111], ds[111];
int main() {
  int n = getint(), m = getint();
  for (auto i = 0; i < n; ++i) {
    as[i] = getint(), bs[i] = getint();
  }
  for (auto i = 0; i < m; ++i) {
    cs[i] = getint(), ds[i] = getint();
  }
  for (auto i = 0; i < n; ++i) {
    int m = 1 << 28;
    int idx = 0;
    for (auto j = 0; j < m; ++j) {
      auto d = abs(as[i] - cs[j]) + abs(bs[i] - ds[j]);
      if (chmin(m, d)) idx = j;
    }
    cout << idx + 1 << endl;
  }
  return 0;
}
