#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
int distance(pair<int, int> student, pair<int, int> check_point) {
  return abs(student.first - check_point.first) +
         abs(student.second - check_point.second);
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> AB, CD;
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    AB.push_back(make_pair(a, b));
  }
  for (int i = 0; i < M; i++) {
    int c, d;
    cin >> c >> d;
    CD.push_back(make_pair(c, d));
  }
  for (int i = 0; i < N; i++) {
    int min_distance = distance(AB[i], CD[0]);
    int index = 1;
    for (int j = 1; j <= M; j++) {
      int current_distance = distance(AB[i], CD[j]);
      if (min_distance > current_distance) {
        index = j + 1;
        min_distance = current_distance;
      }
    }
    cout << index << endl;
  }
}
