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