now = gets.split(":").map(&:to_i) if now[0] == 23 && now[1] >= 55 now[0] = 0 now[1] = (now[1] + 5) % 60 end print format("%02d:", now[0]) print format("%02d\n", now[1])