using System; public class Program { public void Solve() { string[] s = Console.ReadLine().Split(' '); DateTime dt = new DateTime(2017, 10, 26, int.Parse(s[1]), int.Parse(s[2]), 0); int n = int.Parse(s[0]); int t = int.Parse(s[3]); for (int i = 1; i < n; i++) { dt = dt.AddMinutes(t); } Console.WriteLine(dt.Hour); Console.WriteLine(dt.Minute); } public static void Main(string[] args) { Program program = new Program(); program.Solve(); } }