#include <bits/stdc++.h>
using namespace std;
const long long N = 10010;
struct Node {
  long long a, b;
} node[N], poll[N];
long long man(long long x, long long y) {
  return abs(poll[y].a - node[x].a) + abs(poll[y].b - node[x].b);
}
int main() {
  long long a, b;
  cin >> a >> b;
  for (long long i = 0; i < a; i++) {
    cin >> node[i].a >> node[i].b;
  }
  for (long long i = 0; i < b; i++) {
    cin >> poll[i].a >> poll[i].b;
  }
  for (long long i = 0; i < a; i++) {
    long long flag = -1;
    long long manhanten = 1000100;
    for (long long j = 0; j < b; j++) {
      if (manhanten > man(i, j)) {
        manhanten = man(i, j);
        flag = j;
      }
    }
    cout << flag + 1 << endl;
  }
}
