a = gets.to_i hour = a / 100 minute = (a % 100).to_f / 100 * 60 puts "#{10+hour%24}:#{minute.to_i.to_s.rjust(2,"0")}"