https://www.acmicpc.net/problem/2525
using System;
class Program
{
static void Main() {
string[] st=Console.ReadLine().Split(' ');
int h=int.Parse(st[0]);
int m=int.Parse(st[1]);
string st1=Console.ReadLine();
int n=int.Parse(st1);
int sum=m+n;
h+=sum/60;
sum%=60;
h%=24;
Console.Write("{0} {1}",h,sum);
}
}