#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, y, ans, minp;
  int a[50], b[50], c[50], d[50], point[50];
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> a[i] >> b[i];
  for (int i = 0; i < m; ++i) cin >> c[i] >> d[i];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      x = a[i] - c[j];
      if (x < 0) x = -x;
      y = b[i] - d[i];
      if (y < 0) y = -y;
      if (i == 0 && j == 0) {
        minp = x + y;
        ans = 1;
      }
      if (minp < x + y) {
        minp = x + y;
        ans = j + 1;
      }
    }
    point[i] = ans;
  }
  for (int i = 0; i < n; ++i) cout << point[i] << endl;
  return 0;
}
