https://www.acmicpc.net/problem/2525
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int h=s.nextInt();
int m=s.nextInt();
int n=s.nextInt();
int sum=m+n;
h+=sum/60;
sum%=60;
h%=24;
System.out.format("%d %d",h,sum);
}
}