https://www.acmicpc.net/problem/2525
import java.util.*
import java.lang.String.format
fun main(args: Array<String>) {
val s=Scanner(System.`in`)
var h=s.nextInt()
var m=s.nextInt()
var n=s.nextInt()
var sum=m+n
h+=sum/60
sum%=60
h%=24
print(format("%d %d",h,sum))
}