#include <bits/stdc++.h>
using namespace std;
double PI = acos(-1);
int arr[10000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long int n, m, T, res;
  long long int maxi = -(1 << 30) - 1, mini = (1 << 30) - 1, count = 0;
  int i, j, k;
  bool flag;
  string s1, s2;
  char s[100000];
  int ara[100005], ara2[100005];
  cin >> n >> m;
  pair<long long int, long long int> p1[m], p2[m];
  for (int i = (int)(0); i <= (int)(n - 1); i++)
    cin >> p1[i].first >> p1[i].second;
  for (int i = (int)(0); i <= (int)(m - 1); i++)
    cin >> p2[i].first >> p2[i].second;
  for (int i = (int)(0); i <= (int)(n - 1); i++) {
    mini = (1 << 30) - 1;
    for (int j = (int)(0); j <= (int)(m - 1); j++) {
      res = abs(p1[i].first - p2[j].first) + abs(p1[i].second - p2[j].second);
      if (res < mini) {
        T = j + 1;
        mini = min(mini, res);
      }
    }
    cout << T << endl;
  }
}
