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