#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int a[100], b[100], c[100], d[100];
int Min, ans;
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int j = 1; j <= m; j++) {
    cin >> c[j] >> d[j];
  }
  for (int i = 1; i <= n; i++) {
    Min = 99999999;
    for (int j = 1; j <= m; j++) {
      if (Min > (abs(a[i] - c[j]) + abs(b[i] - d[j]))) {
        Min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        ans = j;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
