#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> pos(N);
  vector<pair<int, int>> point(M);
  for (int i = 0; i < N; i++) {
    cin >> pos[i].first >> pos[i].second;
  }
  for (int i = 0; i < M; i++) {
    cin >> point[i].first >> point[i].second;
  }
  for (int i = 0; i < N; i++) {
    int dis = 1e9;
    int cp;
    for (int j = 0; j < N; j++) {
      if (abs(pos[i].first - point[j].first) +
              abs(pos[i].second - point[j].second) <
          dis) {
        dis = abs(pos[i].first - point[j].first) +
              abs(pos[i].second - point[j].second);
        cp = j + 1;
      }
    }
    cout << cp << endl;
  }
  return 0;
}
