#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int a[N], b[N];
  int 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 dist_min = 1e9;
    int cp;
    for (int j = 0; j < (N); j++) {
      int dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dist < dist_min) {
        dist_min = dist;
        cp = j + 1;
      }
    }
    cout << cp << endl;
  }
  return 0;
}
