Var
A: System.DateTime;
i: byte;
begin
readln(i);
A := (new System.DateTime(1990, 1, 1)).AddMonths(i).AddDays(2);
case A.DayOfWeek of
System.DayOfWeek.Monday: writeln('ПН');
System.DayOfWeek.Tuesday: writeln('ВТ');
System.DayOfWeek.Wednesday: writeln('СР');
System.DayOfWeek.Thursday: writeln('Чт');
System.DayOfWeek.Friday: writeln('ПТ');
System.DayOfWeek.Saturday: writeln('СБ');
System.DayOfWeek.Sunday: writeln('ВС');
end;
end.