#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n, m;
  int a[50], b[50], c[50], d[50];
  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];
  int ans[50], min = 200000000;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int p = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      min = (p, min);
    }
    ans[i] = min;
    min = 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (abs(a[i] - c[j]) + abs(b[i] - d[j]) == ans[i]) {
        cout << j + 1 << endl;
        break;
      }
    }
  }
}
