#include <bits/stdc++.h>
using namespace std;
struct p {
  int x, y;
};
int main() {
  int n, m, i;
  cin >> n >> m;
  p st[n], cp[n];
  for (i = 0; i < n; i++) {
    cin >> st[i].x >> st[i].y;
  }
  for (i = 0; i < m; i++) cin >> cp[i].x >> cp[i].y;
  for (i = 0; i < n; i++) {
    int md = 2000000000, ans, a;
    for (int j = 0; j < m; j++) {
      a = abs(st[i].x - cp[j].x) + abs(st[i].y - cp[j].y);
      if (a < md) {
        ans = j + 1;
        md = min(md, a);
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
