#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long int student[100][100], check[100][100];
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2; j++) cin >> student[i][j];
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < 2; j++) cin >> check[i][j];
  }
  long int ans, t = 100000000;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      long int d =
          abs(student[i][0] - check[j][0]) + abs(student[i][1] - check[j][1]);
      if (t == d)
        continue;
      else if (t > d) {
        t = d;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
}
