(w)=l="$System.in".split() 4.times{l=(l-w)*.replace(w,' '*w.count)*.reverse()*.grep{1}.transpose()*.sum()} l.any 0.&println