#include <bits/stdc++.h>
using namespace std;
typedef struct data {
  int x, y;
} Data;
int zettai(int x, int y) { return (x > y) ? x - y : y - x; }
int keisan(Data a, Data b) { return zettai(a.x, b.x) + zettai(a.y, b.y); }
int main() {
  int N, M, min, b, ans;
  cin >> N >> M;
  vector<Data> st(N);
  vector<Data> po(M);
  for (int i = 0; i < N; i++) cin >> st[i].x >> st[i].y;
  for (int i = 0; i < M; i++) cin >> po[i].x >> po[i].y;
  for (int i = 0; i < N; i++) {
    min = -1;
    for (int j = 0; j < N; j++) {
      b = keisan(st[i], po[j]);
      if (b < min || min == -1) {
        min = b;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
