Const
mont: array [1..12] of integer = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var
m, n: integer;
begin
write('m = ');
readln(m);
write('n = ');
readln(n);
if ((m=1) and (n=1)) or (m<1) or (n<1) or (m>12) or (n>mont[m]) then
writeln('Неопределенная дата')
else
if n=1 then
begin
m:=m-1;
n:=mont[m];
writeln(n, '-ое число ', m, '-ый месяц')
end
else
begin
n:=n-1;
writeln(n, '-ое число ', m, '-ый месяц')
end;
end.