#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  int ht[105], test[105];
  for (int i = 1; i <= 2 * N; i++) {
    cin >> ht[i];
  }
  for (int i = 1; i <= 2 * M; i++) {
    cin >> test[i];
  }
  int x, y, xi, yi, ans, xa, ya;
  for (int i = 1; i <= 2 * N; i += 2) {
    int a = 555555;
    x = ht[i];
    y = ht[i + 1];
    for (int j = 1; j <= 2 * M; j += 2) {
      xi = test[j];
      yi = test[j + 1];
      xa = x - xi;
      ya = y - yi;
      if (xa < 0) xa *= -1;
      if (ya < 0) ya *= -1;
      if (a > xa + ya) {
        a = xa + ya;
        ans = (j + 1) / 2;
      }
    }
    cout << ans << endl;
  }
}
