#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, stux[50], stuy[50], chex[50], chey[50];
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> stux[i] >> stuy[i];
  }
  for (int i = 0; i < m; ++i) {
    cin >> chex[i] >> chey[i];
  }
  int min, tmp;
  for (int i = 0; i < n; ++i) {
    min = 100000001;
    for (int j = 0; j < m; ++j) {
      if (abs(stux[i] - chex[j]) + abs(stuy[i] - chey[j]) < min) {
        min = abs(stux[i] - chex[j]) + abs(stuy[i] - chey[j]);
        tmp = j + 1;
      }
    }
    cout << tmp << endl;
  }
  return 0;
}
