#include <bits/stdc++.h>
using namespace std;
long long nx[55], ny[55];
long long mx[55], my[55];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> nx[i] >> ny[i];
  for (int i = 1; i <= m; i++) cin >> mx[i] >> my[i];
  for (int i = 1; i <= n; i++) {
    int minLen = abs(nx[i] - mx[1]) + abs(ny[i] - my[1]);
    int index = 1;
    for (int j = 1; j <= n; j++) {
      if (minLen > abs(nx[i] - mx[j]) + abs(ny[i] - my[j])) {
        minLen = abs(nx[i] - mx[j]) + abs(ny[i] - my[j]);
        index = j;
      }
    }
    cout << index << endl;
  }
  return 0;
}
