#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[60];
  int b[60];
  int c[60];
  int d[60];
  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++) {
    int tmp = 100000010;
    int num = 0;
    for (int j = 0; j < m; j++) {
      int x = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (tmp > x) {
        tmp = x;
        num = j + 1;
      }
    }
    cout << num << endl;
  }
}
