#include <bits/stdc++.h>
using namespace std;
int main() {
  const long long int INF = 10000000000;
  int N, M;
  cin >> N >> M;
  long long int a[N], b[N];
  for (int i = (0); i < (N); ++i) {
    cin >> a[i] >> b[i];
  }
  long long int c[M], d[M];
  for (int i = (0); i < (M); ++i) {
    cin >> c[i] >> d[i];
  }
  long long int e[2][N];
  for (int i = (0); i < (N); ++i) {
    e[1][i] = INF;
  }
  int m;
  for (int i = (0); i < (N); ++i) {
    for (int j = (0); j < (M); ++j) {
      m = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (m < e[1][i]) {
        e[0][i] = j;
        e[1][i] = m;
      }
    }
  }
  for (int i = (0); i < (N); ++i) {
    cout << e[0][i];
    if (i != N - 1) {
      cout << "\n";
    }
  }
}
