import java.util.Scanner; public class Main{ public static void main(String[] args) throws Exception { int h; int m; int t; Scanner sc = new Scanner(System.in); h = sc.nextInt(); // 시간 m = sc.nextInt(); // 분 t = sc.nextInt(); // input 시간 m= m+t; // input 더함 while(m>=60){ // m이 60미만이 될 때까지 if(m>=60){ h = h+1; m = m-60; if(h>=24){ h =0; } } } System.out.println(h + " " + m); } }