import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  int n, m;
  readf("%s %s\n", &n, &m);
  auto p = new int[][](n, 2);
  auto q = new int[][](m, 2);
  foreach (i; 0..n) {
    p[i] = readln.chomp.split.to!(int[]);
  }
  foreach (j; 0..m) {
    q[j] = readln.chomp.split.to!(int[]);
  }
  foreach (i; 0..n) {
    int index;
    auto dist = int.max;
    foreach (j; 0..m) {
      auto dx = abs(p[i][0] - q[j][0]).to!int;
      auto dy = abs(p[i][1] - q[j][1]).to!int;
      if (dx + dy < dist) {
        dist = dx + dy;
        index = j.to!int + 1;
      }
    }
    index.writeln;
  }
}
