Var m:integer;
Begin
Read(m);
if m>24 then write('takogo ne syschestvyet');
if ((m<=6) and (m<=12)) then writeln('dobroe ytro');</p>
if ((m>12) and (m<=18)) then writeln('dobruy den');</p>
if ((m>18) and (m<=21)) then writeln('dobruy vecher');</p>
if ((m>21) or (m<6)) then writeln('spokoyniy nochi');</p>
End.
Я проверила . Все работает.