#include <bits/stdc++.h>
using namespace std;
long long GCD(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return GCD(y, x % y);
}
int main() {
  int n, m;
  cin >> n >> m;
  int sX[n];
  int sY[n];
  int cX[n];
  int cY[n];
  for (int i = 0; i < n; i++) {
    cin >> sX[i] >> sY[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> cX[i] >> cY[i];
  }
  for (int i = 0; i < n; i++) {
    int ans = INT_MAX;
    int ans1 = 0;
    for (int j = 0; j < m; j++) {
      int a = abs(sX[i] - cX[j]) + abs(sY[i] - cY[j]);
      if (a < ans) {
        ans = a;
        ans1 = j + 1;
      }
    }
    cout << ans1 << endl;
  }
}
