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