#include <bits/stdc++.h>
using namespace std;
struct A {
  long long x, y;
  bool flag = false;
} a[1000], b[1000];
int main() {
  long long n, m;
  scanf("%lld", &n);
  scanf("%lld", &m);
  for (long long i = 0; i < n; i++) {
    scanf("%lld", &a[i].x);
    scanf("%lld", &a[i].y);
  }
  for (long long i = 0; i < m; i++) {
    scanf("%lld", &b[i].x);
    scanf("%lld", &b[i].y);
  }
  for (long long i = 0; i < n; i++) {
    long long mini = 0;
    long long minn = 1000000000;
    for (long long j = 0; j < m; j++) {
      if (b[j].flag == false &&
          abs(a[i].x - b[j].x) + abs(a[i].y - b[j].y) < minn) {
        mini = j;
        minn = abs(a[i].x - b[j].x) + abs(a[i].y - b[j].y);
      }
    }
    printf("%lld", mini + 1ll);
    printf("\n");
    b[mini].flag = true;
  }
  return 0;
}
