#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  int a[n], b[n], c[m], d[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++) {
    int min = 200000000;
    int ans = 0;
    for (int j = 0; j < m; j++) {
      int sum1;
      if (a[i] - c[j] >= 0)
        sum1 = a[i] - c[j];
      else
        sum1 = -a[i] + c[j];
      int sum2;
      if (b[i] - d[j] >= 0)
        sum2 = b[i] - d[j];
      else
        sum2 = -b[i] + d[j];
      int sum = sum1 + sum2;
      if (min > sum) {
        min = sum;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
