#include <bits/stdc++.h>
using namespace std;
bool debug = false;
int main() {
  int n, m;
  int a[51], b[51], c[51], d[51];
  cin >> n >> 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 z = 1000000000, point;
    for (int j = 0; j < m; j++) {
      int now = sqrt(pow(a[i] - c[j], 2) + pow(b[i] - d[j], 2));
      if (z > now) {
        z = now;
        point = j + 1;
      }
    }
    cout << point << endl;
  }
  return 0;
}
