require "date" t = gets.chomp t2 = DateTime.strptime(t, "%H:%M") t3 = t2 + Rational(5, 24 * 60) t4 = format("%02d",t3.hour) t5 = format("%02d",t3.min) puts "#{t4}:#{t5}"