#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int N, M, pos, dist;
int main() {
  cin >> N >> M;
  int a[N], b[N], c[M], d[M];
  for (int i = 0; i < (int)(N); i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < (int)(M); i++) {
    cin >> c[i] >> d[i];
  }
  for (int i = 0; i < (int)(N); i++) {
    pos = 0;
    dist = 1e9;
    for (int j = 0; j < (int)(M); j++) {
      if (dist > abs(a[i] - c[i]) + abs(b[i] - d[i])) {
        pos = j;
        dist = abs(a[i] - c[i]) + abs(b[i] - d[i]);
      }
    }
    cout << pos << endl;
  }
}
