#include <bits/stdc++.h>
using namespace std;
int main() {
  int point[50][2];
  int goal[50][2];
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> point[i][0] >> point[i][1];
  }
  for (int i = 0; i < m; i++) {
    cin >> goal[i][0] >> goal[i][1];
  }
  for (int i = 0; i < n; i++) {
    int ans = -1;
    int min = 99999999;
    for (int j = 0; j < m; j++) {
      int ans_t = abs(goal[j][0] - point[i][0]) + abs(goal[j][1] - point[i][1]);
      if (min > ans_t) {
        ans = j;
        min = ans_t;
      }
    }
    cout << ans + 1 << endl;
  }
  return 0;
}
