#include<stdio.h>
void printdate(int year,int month,int day)
{
switch(month)
{
case 1:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("January %d %d\n",day,year);
break;
}
case 2:
{
if((year%4==0&&year%100!=0)||(year%400==0))
{
if(day>29||day<0)
printf("不合理\n");
else
printf("February %d %d\n",day,year);
}
else
{
if(day>28||day<0)
printf("不合理\n");
else
printf("February %d %d\n",day,year);
}
break;
}
case 3:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("March %d %d\n",day,year);
break;
}
case 4:
{
if(day>30||day<0)
printf("不合理\n");
else
printf("April %d %d\n",day,year);
break;
}
case 5:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("May %d %d\n",day,year);
break;
}
case 6:
{
if(day>30||day<0)
printf("不合理\n");
else
printf("June %d %d\n",day,year);
break;
}
case 7:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("July %d %d\n",day,year);
break;
}
case 8:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("August %d %d\n",day,year);
break;
}
case 9:
{
if(day>30||day<0)
printf("不合理\n");
else
printf("September %d %d\n",day,year);
break;
}
case 10:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("October %d %d\n",day,year);
break;
}
case 11:
{
if(day>30||day<0)
printf("不合理\n");
else
printf("November %d %d\n",day,year);
break;
}
case 12:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("December %d %d\n",day,year);
break;
}
}
return;
}
int main()
{
int year,month,day;
while(1)
{
scanf("%d%d%d",&year,&month,&day);
printdate(year,month,day);
}
return 0;
}
void printdate(int year,int month,int day)
{
switch(month)
{
case 1:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("January %d %d\n",day,year);
break;
}
case 2:
{
if((year%4==0&&year%100!=0)||(year%400==0))
{
if(day>29||day<0)
printf("不合理\n");
else
printf("February %d %d\n",day,year);
}
else
{
if(day>28||day<0)
printf("不合理\n");
else
printf("February %d %d\n",day,year);
}
break;
}
case 3:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("March %d %d\n",day,year);
break;
}
case 4:
{
if(day>30||day<0)
printf("不合理\n");
else
printf("April %d %d\n",day,year);
break;
}
case 5:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("May %d %d\n",day,year);
break;
}
case 6:
{
if(day>30||day<0)
printf("不合理\n");
else
printf("June %d %d\n",day,year);
break;
}
case 7:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("July %d %d\n",day,year);
break;
}
case 8:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("August %d %d\n",day,year);
break;
}
case 9:
{
if(day>30||day<0)
printf("不合理\n");
else
printf("September %d %d\n",day,year);
break;
}
case 10:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("October %d %d\n",day,year);
break;
}
case 11:
{
if(day>30||day<0)
printf("不合理\n");
else
printf("November %d %d\n",day,year);
break;
}
case 12:
{
if(day>31||day<0)
printf("不合理\n");
else
printf("December %d %d\n",day,year);
break;
}
}
return;
}
int main()
{
int year,month,day;
while(1)
{
scanf("%d%d%d",&year,&month,&day);
printdate(year,month,day);
}
return 0;
}