#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
const int MXN = 2e5, IINF = 1e9 + 10, INF = 1e18 + IINF + 10, MOD = 1000000007;
const long double PI = 4.0 * atanl(1.0), PREC = .000001;
const char nl = '\n';
long long n, m, t, a[MXN], b[MXN], c[MXN], d[MXN];
void fast() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
int main() {
  fast();
  cin >> n >> m;
  for (int i = 0; i < (n); i++) {
    long long aa, bb;
    cin >> aa >> bb;
    a[i] = aa;
    b[i] = bb;
  }
  for (int i = 0; i < (m); i++) {
    long long cc, dd;
    cin >> cc >> dd;
    c[i] = cc;
    d[i] = dd;
  }
  for (int i = 0; i < (n); i++) {
    long long mx = MXN, idx = MXN;
    for (int j = 0; j < (m); j++) {
      long long dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dis < mx) {
        mx = dis, idx = j + 1;
      }
    }
    cout << idx << "\n";
  }
  return 0;
}
