#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, num, mini, index = 0;
  int a[51], b[51], c[51], d[51];
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  for (int i = 0; i < n; i++) {
    mini = 999999;
    for (int j = 0; j < m; j++) {
      num = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (mini > num) {
        mini = num;
        index = j;
      }
    }
    cout << index + 1 << endl;
  }
}
