def ascan; gets.split.map(&:to_i); end def scan; gets.to_i; end h,m = gets.scan(/(\d+):(\d+)/)[0].map(&:to_i) t = Time.new(1,1,1,h,m) t+= 5*60 puts sprintf("%02d:%02d",t.hour,t.min)