#include <bits/stdc++.h>
using namespace std;
int int_len(int n) {
  int s = 0;
  while (n != 0) s++, n /= 10;
  return s;
}
int int_sum(int n) {
  int m = 0, s = 0, a = n;
  while (a != 0) s++, a /= 10;
  for (int i = s - 1; i >= 0; i--)
    m += n / ((int)pow(10, i)) - (n / ((int)pow(10, i + 1))) * 10;
  return m;
}
int fac(int n) {
  int m = 1;
  while (n >= 1) m *= n, n--;
  return m;
}
int vec_sum(vector<int> v) {
  int n = 0;
  for (int i = 0; i < v.size(); i++) n += v[i];
  return n;
}
int main() {
  int n, m, count = 100, ans = 0;
  cin >> n >> m;
  vector<int> a(n), b(n), c(m), d(m);
  for (int i = 0; i < (n); i++) cin >> a[i] >> b[i];
  for (int i = 0; i < (m); i++) cin >> c[i] >> d[i];
  for (int i = 0; i < (n); i++) {
    for (int j = 0; j < (m); j++) {
      if (count < abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        ans = j + 1;
        count = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      }
      cout << ans << endl;
      count = 100;
    }
  }
}
