#include <bits/stdc++.h>
using namespace std;
__attribute__((constructor)) void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}
signed main() {
  long long n, m;
  cin >> n >> m;
  pair<long long, long long> s[51], p[51];
  for (long long i = (0); i < (n); i++) {
    cin >> s[i].first >> s[i].second;
  }
  for (long long i = (0); i < (m); i++) {
    cin >> p[i].first >> p[i].second;
  }
  for (long long i = (0); i < (n); i++) {
    long long mn = 1145141919;
    long long mi;
    long long a = s[i].first, b = s[i].second;
    for (long long j = (0); j < (m); j++) {
      long long c = p[j].first, d = p[j].second;
      if (i == 1) cout << ":" << abs(a - c) + abs(b - d) << endl;
      if (mn > abs(a - c) + abs(b - d)) {
        mn = abs(a - c) + abs(b - d);
        mi = j;
      }
    }
    cout << mi + 1 << endl;
  }
}
