#include <bits/stdc++.h>
using namespace std;
long double pi = acos(-1);
const int INF = 1001001001;
int euqlid(int a, int b) {
  int temp;
  temp = a % b;
  if (temp == 0) return b;
  return euqlid(b, temp);
}
long long conbination(long long a, long long b) {
  long long u = 1;
  long long d = 1;
  while (b != 0) {
    u *= a;
    d *= b;
    a--;
    b--;
  }
  return u / d;
}
int strtoint(char s) { return (int(s - '0')); }
char changeS(char alpha) {
  if (0x41 <= alpha and alpha <= 0x5A)
    return (alpha + 0x20);
  else if (0x61 <= alpha and alpha <= 0x7A)
    return (alpha - 0x20);
  return alpha;
}
int fact(int n) {
  if (n == 1) return 1;
  return n * fact(n - 1);
}
int ceil(int a, int b) { return (a + b - 1) / b; }
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 len = abs(a[i] - c[0]) + abs(b[i] - d[0]);
    int cp = -1;
    for (int j = 1; j < m; j++) {
      int dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (len > dist) {
        len = dist;
        cp = j + 1;
      }
    }
    cout << cp << endl;
  }
}
