main=do
  a<-map(map read.words).lines<$>getContents
  putStr$unlines$f 0(a!!0!!0)(a!!0!!1)(tail a)
f i n m a=if i>=n then[]else (show(snd(minimum[((abs(((snd s)!!0)-(a!!i!!0)))+(abs(((snd s)!!1)-(a!!i!!1))),(fst s))|s<-(zip[1..](drop n a))]))):f(i+1)n m a
