#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int s[n][2], c[m][2];
  for (int i = 0; i < n; i++) cin >> s[i][0] >> s[i][1];
  for (int i = 0; i < n; i++) cin >> c[i][0] >> c[i][1];
  int ans[n];
  for (int i = 0; i < n; i++) {
    ans[i] = 0;
    long long int dist = abs(s[i][0] - c[0][0]) + abs(s[i][1] - c[0][1]);
    for (int j = 1; j < m; j++) {
      long long int td = abs(s[i][0] - c[j][0]) + abs(s[i][1] - c[j][1]);
      if (td < dist) {
        ans[i] = j;
        dist = td;
      }
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] + 1 << endl;
}
