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