#include <bits/stdc++.h>
using namespace std;
int n, m, a[60], b[60], c[60], d[60];
int main() {
  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 ans = 0;
    int dis = (a[i] - c[0]) * (a[i] - c[0]) + (b[i] - d[0]) * (b[i] - d[0]);
    for (int j = 1; j < m; j++) {
      if (dis > (a[i] - c[j]) * (a[i] - c[j]) + (b[i] - d[j]) * (b[i] - d[j])) {
        dis = (a[i] - c[j]) * (a[i] - c[j]) + (b[i] - d[j]) * (b[i] - d[j]);
        ans = j;
      }
    }
    cout << ans + 1 << endl;
  }
  return 0;
}
