#include <bits/stdc++.h>
using namespace std;
struct dot {
  int x, y;
} a[51], b[51];
int n, m;
int main() {
  cin >> n >> m;
  int i, j;
  for (i = 1; i <= n; i++) cin >> a[i].x >> a[i].y;
  for (i = 1; i <= m; i++) cin >> b[i].x >> b[i].y;
  for (i = 1; i <= n; i++) {
    int minn = pow(10, 8) + 4, k;
    for (j = 1; j <= m; j++) {
      int dis = abs(a[i].x - b[j].x) + abs(a[i].y - b[j].y);
      if (dis < minn) minn = dis, k = j;
    }
    cout << k << endl;
  }
  return 0;
}
