#include<iostream.h>
class CDate
{
private:
int year,month,day;
public:
void WO(int y,int m,int d)
{
year=y;
month=m;
day=d;
}
void Print()
{
cout<<month<<"月"<<day<<"日"<<year<<"年";
}
void M()
{
int flag;
switch(month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
if(day<31)
{
day=day+1;
cout<<month<<"月"<<day<<"日"<<year<<"年";
}
else
cout<<month+1<<"月"<<1<<"日"<<year<<"年";break;
case 12:
if(day==31)
{
year=year+1;
month=1;
day=1;
cout<<month<<"月"<<day<<"日"<<year<<"年";
}
else
cout<<month<<"月"<<day+1<<"日"<<year<<"年";break;
case 4:
case 6:
case 9:
case 11:
if(day==30)
{
month=month+1;
day=1;
cout<<month<<"月"<<day<<"日"<<year<<"年";
}
else
cout<<month<<"月"<<day+1<<"日"<<year<<"年";break;
case 2:
if(!(year%400))
flag=1;
else if(!(year%4)&&year%100)
flag=1;
else flag=0;
if(flag)
if(day==29)
{
month=month+1;
day=1;
cout<<month<<"月"<<day<<"日"<<year<<"年";
}
else
cout<<month<<"月"<<day+1<<"日"<<year<<"年";
else
if(day==28)
{
month=month+1;
day=1;
cout<<month<<"月"<<day<<"日"<<year<<"年";
}
else
cout<<month<<"月"<<day+1<<"日"<<year<<"年";
}
}
};
void main()
{
int y,m,d;
cin>>y>>m>>d;
CDate date1;
date1.WO(y,m,d);
date1.Print();
date1.M();
}