#include <bits/stdc++.h>
using namespace std;
int A[1000000], n;
int binarySearch(int key) {
  int left = 0;
  int right = n;
  int mid;
  while (left < right) {
    mid = (left + right) / 2;
    if (key == A[mid]) return 1;
    if (key > A[mid])
      left = mid + 1;
    else if (key < A[mid])
      right = mid;
  }
  return 0;
}
int prime(int x) {
  if (x < 2) return 0;
  if (x == 2) return 1;
  if (x % 2 == 0) return 0;
  for (int i = 3; i * i <= x; i += 2) {
    if (x % i == 0) return 0;
  }
  return 1;
}
int gcd(int x, int y) {
  int r;
  if (x < y) swap(x, y);
  while (y > 0) {
    r = x % y;
    x = y;
    y = r;
  }
  return x;
}
int main() {
  int n, m, k;
  long long int dis, min, x, y;
  cin >> n >> m;
  vector<long long> a(n);
  vector<long long> b(n);
  vector<long long> c(m);
  vector<long long> d(m);
  vector<long long> ans;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  for (int i = 0; i < n; i++) {
    min = 100000001;
    for (int j = 0; j < m; j++) {
      x = c[i] - a[j];
      y = d[i] - b[j];
      dis = ((x) > 0 ? (x) : (x * -1)) + ((y) > 0 ? (y) : (y * -1));
      if (min > dis) {
        min = dis;
        k = j;
      }
    }
    ans.push_back(k + 1);
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << endl;
  }
}
