#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int m;
  int a[100];
  int b[100];
  int c[100];
  int d[100];
  int i, j;
  int min, ans;
  cin >> n;
  cin >> m;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    cin >> b[i];
  }
  for (j = 1; j <= m; j++) {
    cin >> c[j];
    cin >> d[j];
  }
  for (i = 1; i <= n; i++) {
    min = 999999;
    ans = 0;
    for (j = 1; j <= m; j++) {
      if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
        ans = j;
        min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
