using System; using System.Linq; class Program { static void Main(string[] args) { int[] NHMT = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray(); int H = NHMT[1]; int M = NHMT[2]; int sleep = NHMT[3] * (NHMT[0] - 1); M += sleep % 60; H += sleep / 60; Console.WriteLine(H); Console.WriteLine(M); } }