#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000;
int n, m, a[60], b[60], c[60], d[60];
int func(int id) {
  int best = INT_MAX;
  int ans = -1;
  for (int j = 0, j_len = (m); j < j_len; ++j) {
    int dist = abs(a[id] - c[j]) + abs(b[id] - d[j]);
    if (dist < best) {
      best = dist;
      ans = j;
    }
  }
  return ans + 1;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0, i_len = (n); i < i_len; ++i) cin >> a[i] >> b[i];
  for (int j = 0, j_len = (m); j < j_len; ++j) cin >> c[j] >> d[j];
  for (int i = 0, i_len = (n); i < i_len; ++i) cout << func(i) << endl;
  return 0;
}
