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