n=gets.to_i n.times do s = gets.chomp s =~ /([1-9]*|0)([^\d]*?)\z/ if $1.length > 0 puts ($` << ($1.to_i + 1).to_s << $2) else puts s end end