def ascan; gets.split.map{|e|Rational(e)}; end def scan; gets.to_i; end gets while cin=gets str = cin.chomp #puts str.succ if str=~/\d/ str = "$"+str sc = str.scan(/^(.*\D+)(\d+)(\D*)$/)[0] puts sc[0][1..-1]+sc[1].succ+sc[2] else puts str end end