#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  int a[n], b[n], c[m], d[m];
  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++) {
    int x = a[i];
    int y = b[i];
    int dis = 10000000000000000000;
    int kyori = 0;
    for (int i = 0; i < m; i++) {
      int v = abs(x - c[i]) + abs(y - d[i]);
      if (dis > v) {
        dis = v;
        kyori = i;
      }
    }
    cout << kyori + 1 << endl;
  }
}
