#include <bits/stdc++.h>
using namespace std;
int a[101], b[101], c[101], d[101];
int main() {
  int n, m, dis = 0, num, far;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i] >> b[i];
  for (int i = 1; i <= m; i++) cin >> c[i] >> d[i];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      far = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (far < dis) {
        dis = far;
        num = j;
      }
    }
    cout << num << endl;
  }
  return 0;
}
