#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x1[100];
  long long x2[100];
  long long y1[100];
  long long y2[100], dist, cnt, n, m;
  long long mn = 90000000;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> x1[i] >> y1[i];
  for (int i = 0; i < m; i++) cin >> x2[i] >> y2[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      dist = abs(x1[i] - x2[j]) + abs(y1[i] - y2[j]);
      if (dist < mn) {
        mn = dist;
        cnt = j + 1;
      }
    }
    mn = 90000000;
    cout << cnt << "\n";
  }
}
