s='' i=n=0 "$System.in".each{d=i?s[i-1]:0 e=++i>50?s[i-51]:0 s+=it-'#'?:d>' '?d:e>' '?e:++n} print s