#include <bits/stdc++.h>
using namespace std;
long long modinv(long long a, long long m) {
  long long b = m, u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
int main() {
  int n, m;
  cin >> n >> m;
  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++) {
    int ans;
    int x = a[i], y = b[i];
    int kyori = 1000000;
    for (int j = 0; j < (m); j++) {
      int kari = abs(x - c[j]) + abs(y - d[j]);
      if (kari < kyori) {
        ans = j + 1;
        kyori = kari;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
