#include <bits/stdc++.h>
using namespace std;
int x[55], y[55], a[55], b[55];
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x[i], &y[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a[i], &b[i]);
  }
  for (int i = 0; i < n; i++) {
    int ans = 0;
    int mmin = 0x3f3f3f3f;
    for (int j = 0; j < m; j++) {
      int sum = abs(x[i] - a[j]) + abs(y[i] - b[j]);
      if (sum < mmin) {
        mmin = sum;
        ans = j;
      }
    }
    printf("%d\n", ans + 1);
  }
}
