#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int st[a][2];
  vector<vector<int>> table(b, vector<int>(2));
  for (int i = 0; i < a; i++) {
    cin >> st[i][0] >> st[i][1];
  }
  for (int i = 0; i < b; i++) {
    cin >> table[i][0] >> table[i][1];
  }
  int result[a];
  for (int i = 0; i < a; i++) {
    int log = 0;
    int route = abs(st[i][0] - table[0][0]) + abs(st[i][1] - table[0][1]);
    for (int j = 1; j < b; j++) {
      int z = abs(st[i][0] - table[j][0]) + abs(st[i][1] - table[j][1]);
      if (route > z) {
        route = z;
        log = j;
      } else if (route = z) {
        for (int y = 0; y < i; y++) {
          if (result[y] == log) break;
          if (y == i - 1) log = z;
        }
      }
    }
    result[i] = log;
  }
  for (int i = 0; i < a; i++) {
    cout << result[i] << endl;
  }
}
