#include <bits/stdc++.h>
using namespace std;
long long int s[3001], ss[3001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m, mini;
  cin >> n >> m;
  long long int x[n], y[n], x1[m], y1[m];
  for (long long int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  for (long long int i = 0; i < m; i++) {
    cin >> x1[i] >> y1[i];
  }
  long long int d, pos;
  for (long long int i = 0; i < n; i++) {
    mini = 999999;
    for (long long int j = 0; j < m; j++) {
      d = abs(x[i] - x1[j]) + abs(y[i] - y1[j]);
      if (d < mini) {
        mini = d;
        pos = j;
      } else if (d == mini) {
        mini = d;
        pos = min(pos, j);
      }
    }
    cout << pos + 1 << endl;
  }
  return 0;
}
