s='#' s=('1 '..$_).map{gets s.gsub(/.*/){chomp.chars.map{|c|$&.tr'#',c}}}*$/while'1'<