import std.stdio, std.conv; import std.algorithm, std.range, std.random; import std.string, std.array, std.container, std.bigint; import std.typecons, std.ascii; import std.datetime; int main() { long n; int h, m, t; readf("%d %d %d %d\n", &n, &h, &m, &t); auto st = TimeOfDay(h, m); st += dur!"minutes"((n-1) * t); writeln(st.hour); writeln(st.minute); return 0; }