using System; using System.Linq; using System.Collections.Generic; class Program { static void Main(string[] args) { string[] su = Console.ReadLine().Split(); int cnt = int.Parse(su[0]) - 1; int h = int.Parse(su[1]); int m = int.Parse(su[2]); int time = int.Parse(su[3]); m += time * cnt; h += m / 60; m = m % 60; if (h >= 24) { h -= 24; } Console.WriteLine(h); Console.WriteLine(m); Console.Read(); } }