#include <bits/stdc++.h>
using namespace std;
int main() {
  pair<long, long> s[50];
  pair<long, long> c[50];
  int N, M;
  cin >> N >> M;
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    s[i] = make_pair(a, b);
  }
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    c[i] = make_pair(a, b);
  }
  for (int i = 0; i < N; i++) {
    pair<int, long> p = make_pair(0, 1e8);
    for (int j = 0; j < M; j++) {
      long dist = abs(c[j].first - s[i].first) + abs(c[j].second - s[i].second);
      if (dist < p.second) {
        p.first = j + 1;
        p.second = dist;
      }
    }
    cout << p.first << endl;
  }
  return 0;
}
