gets p 1.upto(9){|n| gsub(/^(.{#{(~/#\S*\s/)%51}})(#$&)/s){$1+$2.tr('^ ',n.to_s)}} print