n,d,t,*x=$<.read.split.map &:to_i t.times{y=[];x.map{|e|y<