#include <bits/stdc++.h>
using namespace std;
struct fastio {
  fastio() {
    ios::sync_with_stdio(false);
    cout << setprecision(10) << fixed;
    cin.tie(0);
  }
};
fastio _fast_io;
const int N = 51;
int n, m;
pair<int, int> s[N], c[N];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> s[i].first >> s[i].second;
  }
  for (int i = 0; i < m; ++i) {
    cin >> c[i].first >> c[i].second;
  }
  for (int i = 0; i < n; ++i) {
    long long int ans = LLONG_MAX;
    long long int ri = 0;
    for (int j = 0; j < m; ++j) {
      long long int x = s[i].first - c[j].first;
      long long int y = s[i].second - c[j].second;
      if (x * x + y * y < ans) {
        ans = x * x + y * y;
        ri = j;
      }
    }
    cout << ri + 1 << endl;
  }
  return 0;
}
