eval'N,D,K,*X='+$<.read.split*?,
c=h=X[m=0]
N.times{|j|a,f=X[j],[j+D,N-1].min
a>c&&X[f]<=X[h]||(j+1..f).any?{|k|v=X[k]-a;v>m[0]&&m=[v,j,k];v<0}
c,h=a-1,f}
puts m[0]<1?0:[m.shift*K,m*' ']