uses crt;
var x, y: byte;
s1, s2: string;
begin
write ('первый момент = ');
readln (s1);
write ('второй момент = ');
readln (s2);
if (s2 < '12:59') then write ('12-hour clock') else
if (s1 = '00:00') or (s2 = '00:00') then write ('24-hour clock') else
if (s1 > '12:59') or (s2 > '12:59') then write ('24-hour clock') else
if (s1 = '12:00') or (s2 = '12:00') then write ('24-hour clock')
else writeln ('12-hour clock');
end.