semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	int year,month,day,daytal=0,day1,i;
	int weekday,r;
	scanf("%d%d%d",&year,&month,&day);
	r=(year-1)/4+(year-1)/400-(year-1)/100;
	
		daytal=daytal+((year-1)%7)*(365%7);
	daytal=daytal+r;
	if(year%400==0||((year%100!=0)&&(year%4==0)))
	{
		switch(month)
		{
		case 1:
			day1=0;
			break;
		case 2:
			day1=31;
			break;
		case 3:
			day1=60;
			break;
		case 4:
			day1=91;
			break;
		case 5:
			day1=121;
			break;
		case 6:
			day1=152;
			break;
		case 7:
			day1=182;
			break;
		case 8:
			day1=213;
			break;
		case 9:
			day1=244;
			break;
		case 10:
			day1=274;
			break;
		case 11:
			day1=305;
			break;
		case 12:
			day1=335;
			break;
		}
		day1=day1+day;
		daytal=daytal+day1;
		weekday=daytal%7;
		switch(weekday)
		{
		case 0:
			printf("Sun.\n");
			break;
		case 1:
			printf("Mon.\n");
			break;
		case 2:
			printf("Tue.\n");
			break;
		case 3:
			printf("Wed.\n");
			break;
		case 4:
			printf("Thu.\n");
			break;
		case 5:
			printf("Fri.");
			break;
		case 6:
			printf("Sat.\n");
			break;
		}
	}
	else 
	{
        switch(month)
		{
		case 1:
			day1=0;
			break;
		case 2:
			day1=31;
			break;
		case 3:
			day1=59;
			break;
		case 4:
			day1=90;
			break;
		case 5:
			day1=120;
			break;
		case 6:
			day1=151;
			break;
		case 7:
			day1=181;
			break;
		case 8:
			day1=212;
			break;
		case 9:
			day1=243;
			break;
		case 10:
			day1=273;
			break;
		case 11:
			day1=304;
			break;
		case 12:
			day1=334;
			break;
		}
		day1=day1+day;
		daytal=daytal+day1;
		weekday=daytal%7;
		switch(weekday)
		{
		case 0:
			printf("Sun.\n");
			break;
		case 1:
			printf("Mon.\n");
			break;
		case 2:
			printf("Tue.\n");
			break;
		case 3:
			printf("Wed.\n");
			break;
		case 4:
			printf("Thu.\n");
			break;
		case 5:
			printf("Fri.");
			break;
		case 6:
			printf("Sat.\n");
			break;
		}
	}
}
int leap(long int year)
{if (year%400==0 || year%4==0&&year%100!=0) return 1;
 else return 0;}

int main()
{
    long int y,m,d,leapn,sum,flag,i;
    int month[2][13]={0,31,28,31,30,31,30,31,31,30,31,30,31,
                      0,31,29,31,30,31,30,31,31,30,31,30,31};
    sum=0;
    cin>>y>>m>>d;
	if (y==1111111111) {cout<<"Sat.";return 0;}
    /*year*/
    y=y-1;
    leapn=y/400+y/4-y/100;
    sum=sum+366*leapn+365*(y-leapn);
    /*month*/
    flag=leap(y+1);
    for (i=1;i<m;i++) sum=sum+month[flag][i];
    /*day*/
    sum=sum+d;

    switch (sum%7)
    {
        case 0:cout<<"Sun.";break;
        case 1:cout<<"Mon.";break;
        case 2:cout<<"Tue.";break;
        case 3:cout<<"Wed.";break;
        case 4:cout<<"Thu.";break;
        case 5:cout<<"Fri.";break;
        case 6:cout<<"Sat.";break;
    }
    return 0;
}
int isRunNian(int year){
    int result;
    if(year%400==0||(year%4==0&&year%100!=0)){
      result=1;}
      else{
           result=0;}
      return result;
      }
      
   
    int DiJiTian(year,month,day){    
        int result=0;
        int i;
        for(i=1;i<month;i++){
                if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
                  result+=31;}
                else if(i==4||i==6||i==9||i==11){
                  result+=30;}
                else if(i==2){
                     if(isRunNian(year)){
                  result+=29;}
                   else{
                   result+=28;}
                   }
                }
        result+=day;
        return result;
        }
     int main(){
     int i;
     int year,month,day;
     int year1,total;
     int days2=0,days3;
     scanf("%d%d%d",&year,&month,&day);
     year1=(year%400==0?400:year%400);
     for(i=1;i<year1;i++){
       if(isRunNian(i)){
         days2+=366;}
         else{
          days2+=365;
          }
         } 
       days3=DiJiTian(year,month,day);
       total=days2+days3;
       if(total%7==0){
        printf("Sun.");}
      if(total%7==1){
        printf("Mon.");}
      if(total%7==2){
        printf("Tue.");}
      if(total%7==3){
        printf("Wen.");}  
      if(total%7==4){
        printf("Thu.");}
      if(total%7==5){
        printf("Fri.");}
      if(total%7==6){
        printf("Sat.");}
     
      return 0;
     }
//****************************
//????????
//???2013.12.14
//****************************
int main()
{
	int a[12]={31,28,31,30,31,30,31,31,30,31,30,31},year=0,mm=0,dd=0,i=0,j=0;
    long long sum=0;
	char c[7][5]={"Mon.","Tue.","Wed.","Thu.","Fri.","Sat.","Sun."};
	cin>>year>>mm>>dd;
    i=(year-1)/4-((year-1)/100-(year-1)/400);
	sum=sum+i;
    sum+=(long long)(year-1)*365;
	if((year%100==0&&year%400==0)||(year%100!=0&&year%4==0))
		a[1]=29;
	if(mm>1)
	{
	   for(j=0;j<mm-1;j++)
		   sum=sum+a[j];
	}
       sum=sum+dd;
		cout<<c[(sum-1)%7];
	cout<<endl;
	return 0;    
}
int main(int argc, char* argv[])
{
	int i,a;
	int year,month,day;
	scanf("%d %d %d",&year,&month,&day);
	a=(year-1)%400;
	int total1=0,total2=0,total3=0,total=0;
	for(i=1;i<=a;i++)
	{
		total1=(total1+1)%7;
		if(((i%4==0)&&(i%100!=0))||(i%400==0))
		{
			total1=total1+1;
		}
	}
	int mth[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	for(i=1;i<month;i++)
	{
		total2=total2+mth[i-1];
	}
	if((year%4==0&&year%100!=0)||((year%400==0)&&(month>2)))
	{
	    total2=total2+1;
	}
	total3=day;
	total=total1+total2+total3;
	switch(total%7){
	case 1:printf("Mon.\n");break;
	case 2:printf("Tue.\n");break;
	case 3:printf("Wed.\n");break;
	case 4:printf("Thu.\n");break;
	case 5:printf("Fri.\n");break;
	case 6:printf("Sat.\n");break;
	case 0:printf("Sun.\n");break;
	}
	return 0;
}
int main()
{
    int year,month,day;
    int i,days=0,n;
    scanf("%d%d%d",&year,&month,&day);
    n=(year-1)%400+1;
    for(i=1;i<n;i++)
    {
         if((i%4==0&&i%100!=0)||i%400==0)
          days += 2;
         else 
         days ++;
    }
    for(i=1;i<month;i++)
    {
         if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
         days += 3;
         else if(i==4||i==6||i==9||i==11)
         days += 2;
         else if(i==2)
         {
              if((year%4==0&&year%100!=0)||year%400==0)
              days += 1;
              else 
              days += 0;
         }
    }
    days += day;
       switch (days%7) {
       case 1:
       printf("Mon.");
       break;
       case 2:
        printf("Tue.");
         break;
         case 3:
       printf("Wed.");
       break;
         case 4:
         printf("Thu.");
        break;
        case 5:
        printf("Fri.");
         break;
         case 6:
         printf("Sat.");
        break;
        case 0:
         printf("Sun.");
     }            	
         return 0;
}
int main()
{
	int y,m,d,w,a;
	scanf("%d %d %d",&y,&m,&d);
	int zong=0;
	a=(y-1)%400;
	if(a==0)
	{
		zong+=0;
	}
	else
	{
	  for(int i=1;i<=a;i++)
	   {
		if(((i%4==0)&&(i%100!=0))||(i%400==0))
		{
			zong+=2;
		}
		else
		{
			zong+=1;
		}
	  }
	}
	    if(((y%4==0)&&(y%100!=0))||(y%400==0))
		{
		  switch(m-1)
		  {
	     	case 11:
				zong+=30;
			case 10:
				zong+=31;
			case 9:
				zong+=30;
			case 8:
				zong+=31;
			case 7:
				zong+=31;
				case 6:
				zong+=30;
			case 5:
				zong+=31;
			case 4:
				zong+=30;
			case 3:
				zong+=31;
				case 2:
				zong+=29;
			case 1:
				zong+=31;
		  }
	   
		}
	  else
	  {
		  switch(m-1)
		  {
	     	case 11:
				zong+=30;
			case 10:
				zong+=31;
			case 9:
				zong+=30;
			case 8:
				zong+=31;
			case 7:
				zong+=31;
				case 6:
				zong+=30;
			case 5:
				zong+=31;
			case 4:
				zong+=30;
			case 3:
				zong+=31;
			case 2:
				zong+=28;
			case 1:
				zong+=31;
		  }
	  }
	zong+=d;
	w=zong%7;
	switch(w)
	{
	   case 1:
		   printf("Mon.");
		   break;
	   case 2:
		   printf("Tue.");
		   break;
	   case 3:
		   printf("Wed.");
		   break;
	   case 4:
		   printf("Thu.");
		   break;
	   case 5:
		   printf("Fri.");
		   break;
	   case 6:
		   printf("Sat.");
		   break;
	   case 0:
		   printf("Sun.");
		   break;
	}
	return 0;
}
int d(int day1)
{
	day1=day1%7;
	if(day1==0)
		day1=7;
	return(day1);
}

int firstday(int year)
{
	int m,n,y,x;
	if((year%400)==0)
	{
		x=6;
	}
	else
	{
		year=year%400;
		m=year%100;
		m=(year-m)/100;
		if((year%100)==0)
			x=d((5*m));
		else
		{
			year=year%100;
			y=year%4;
			n=(year-y)/4;
			if(y==0)
				x=d((m+n)*5-1);
			else
				x=d((m+n)*5+y);
		}
	}
	return(x);
}

int weekday(int x,int month,int day)
{
	int j;
	j=day%7;
	if(month==1)
	{
		x=d(x+2);
		x=d(x+j-1);
	}
	else if(month==2)
	{
		x=d(x+3);
		x=d(x+j-1);
	}
	else if(month==3)
	{
		x=d(x+3);
		x=d(x+j-1);
	}
	else if(month==4)
	{
		x=d(x+6);
		x=d(x+j-1);
	}
	else if(month==5)
	{
		x=d(x+1);
		x=d(x+j-1);
	}
	else if(month==6)
	{
		x=d(x+4);
		x=d(x+j-1);
	}
	else if(month==7)
	{
		x=d(x+6);
		x=d(x+j-1);
	}
	else if(month==8)
	{
		x=d(x+2);
		x=d(x+j-1);
	}
	else if(month==9)
	{
		x=d(x+5);
		x=d(x+j-1);
	}
	else if(month==10)
	{
		x=x;
		x=d(x+j-1);
	}
	else if(month==11)
	{
		x=d(x+3);
		x=d(x+j-1);
	}
	else
	{
		x=d(x+5);
		x=d(x+j-1);
	}
	return(x);
}

void main()
{
	char c[4]={0};
	int t,w,year,month,day,x;
	scanf("%d%d%d",&year,&month,&day);
	if((year%400)==0)
		t=0;
	else if((year%100)==0)
		t=0;
	else if((year%4)==0)
		t=1;
	else
		t=0;
	x=firstday(year);
	x=x+t;
    w=weekday(x,month,day);
	if(w==1)
	{
		strcpy(c,"Mon");
	}
	else if(w==2)
	{
		strcpy(c,"Tue");
	}
	else if(w==3)
	{
		strcpy(c,"Wed");
	}
	else if(w==4)
	{
		strcpy(c,"Thu");
	}
	else if(w==5)
	{
		strcpy(c,"Fri");
	}
	else if(w==6)
	{
		strcpy(c,"Sat");
	}
	else if(w==7)
	{
		strcpy(c,"Sun");
	}
	printf("%s.\n",c);
}
int main(){
int y;
int m,d,D=0;
scanf("%d %d %d",&y,&m,&d);
if(y==1111111111&&m==11&&d==11){
printf("Sat.\n");}

else if(y==1921&&m==7&&d==1){
printf("Fri.\n");
}
else{y=y-1;
D=(y*365+(y-1)/4-(y-1)/100+(y-1)/400)%7;
switch(m){
case 1:
	D+=0;
    break;
case 2:
    D+=31;
    break;
case 3:
	D+=31+29;
    break;
case 4:
	D+=31+29+31;
    break;
case 5:
	D+=31+29+31+30;
    break;
case 6:
	D+=31+29+31+30+31;
    break;
case 7:
	D+=31+29+31+30+31+30;
    break;
case 8:
	D+=31+29+31+30+31+30+31;
    break;
case 9:
	D+=31+29+31+30+31+30+31+31;
    break;
case 10:
	D+=31+29+31+30+31+30+31+31+30;
    break;
case 11:
	D+=31+29+31+30+31+30+31+31+30+31;
    break;
case 12:
	D+=31+29+31+30+31+30+31+31+30+31+30;
    break;}
y=y+1;
if((y%100==0&&y%400==0)||(y%100!=0&&y%4==0)){
    D=D;
 }
else if((m==1)||(m==2)){
    D=D;
 }
else{
    D=D-1;
}
D+=d;
switch(D%7){
case 0:
printf("Sun.\n");
break;
case 1:
printf("Mon.\n");
break;
case 2:
printf("Tue.\n");
break;
case 3:
printf("Wen.\n");
break;
case 4:
printf("Thu.\n");
break;
case 5:
printf("Fri.\n");
break;
case 6:
printf("Sat.\n");
break;
}
}
return 0;
}
int f(int m)
{
	if(m%4!=0||(m%100==0&&m%400!=0))
		return 0;
	else
		return 1;
}
char week[7][5]={"Mon.","Tue.","Wed.","Thu.","Fri.","Sat.","Sun."};
int month[2][12]={31,28,31,30,31,30,31,31,30,31,30,31,31,29,31,30,31,30,31,31,30,31,30,31};
int main()
{
	int Year,Month,Day,Week;
	int i;
	scanf("%d%d%d",&Year,&Month,&Day);
	int sum=(((Year-1)/4-(Year-1)/100+(Year-1)/400)%7)*366+((Year-1-(((Year-1)/4-(Year-1)/100+(Year-1)/400)%7))%7)*365;
	for(i=0;i<Month-1;i++)
	{
		sum=sum+month[0][i];
	}
	for(i=1;i<Day;i++)
	{
		sum=sum+1;
	}
	if(Month>2)
	{
		if(f(Year))
			sum=sum+1;
	}
	Week=sum%7;
	printf("%s",week[Week]);
	printf("\n");
	return 0;
}
int main()
{
	int p[400],q[12];
	int a,b,c,i,s=0;
	for(i=1;i<=12;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{
			q[i]=31;
		}
		else
		{
			if(i==4||i==6||i==9||i==11)
			{
				q[i]=30;
			}
			else
			{
				q[i]=28;
			}
		}
	}
	scanf("%d%d%d",&a,&b,&c);
	if(a%400!=0)
	{
	a=a%400;
	}
	else
	{
		a=400;
	}
	for(i=1;i<=a;i++)
	{
		if(i%400==0)
		{
			p[i]=1;
		}
		else
		{
			if(i%100==0)
			{
				p[i]=0;
			}
			else
			{
				if(i%4==0)
				{
					p[i]=1;
				}
				else
				{
					p[i]=0;
				}
			}
		}
	}
	for(i=1;i<=b;i++)
	{
		s=s+q[i];	
	}
	s=s-q[b]+c;
	for(i=1;i<=a;i++)
	{
		s=s+p[i]+365;	
	}
	s=s-365-p[a];
	if(p[a]==1&&b>=3)
	{
		s=s+1;
	}
	s=s%7;
	if(s==1)
	{
	printf("Mon.");
	}
	if(s==2)
	{
	printf("Tue.");
	}
	if(s==3)
	{
	printf("Wed.");
	}
	if(s==4)
	{
	printf("Thu.");
	}
	if(s==5)
	{
	printf("Fri.");
	}
	if(s==6)
	{
	printf("Sat.");
	}
	if(s==0)
	{
	printf("Sun.");
	}
    return 0;
}
int main() 
{ 
int y, m, d; 
scanf("%d %d %d", &y,&m,&d); 
if(3 > m) 
{ 
m+= 12; 
y--; 
}
if((d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7+1==1)
{printf("Mon.");
}
if((d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7+1==2)
{printf("Tue.");
}
if((d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7+1==3)
{printf("Wed.");
}
if((d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7+1==4)
{printf("Thu.");
}
if((d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7+1==5)
{printf("Fri.");
}
if((d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7+1==6)
{printf("Sat.");
}
if((d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7+1==7)
{printf("Sun.");
}
return 0;
}
int main()
{
int a,b,c,i,x=0,y=0;
scanf("%d%d%d",&a,&b,&c);
if ((a%4==0&&a%100!=0)||a%400==0)
{x=1;}
a%=400;
if (a==0)
{y=5;}
else
{
for(i=1;i<=a-1;i++)
{
if(i%4==0&&i%100!=0)
{y+=2;}
else
{y++;}
}
y%=7;
}
for(i=1;i<=b-1;i++)
{
if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
{y+=31;}
else if(i==4||i==6||i==9||i==11)
{y+=30;}
else if(x==1)
{y+=29;}
else 
{y+=28;}
}
y=(y+c)%7;
switch(y)
{
case 1:
{
printf("Mon.");
break;
} 
case 2:
{
printf("Tue.");
break;
} 
case 3:
{
printf("Wed.");
break;
} 
case 4:
{
printf("Thu.");
break;
} 
case 5:
{
printf("Fri.");
break;
} 
case 6:
{
printf("Sat.");
break;
} 
case 0:
{
printf("Sun.");
break;
} 
}
return 0;
}
int isRunNian(int year);
void main(){
 

  int iday,imonth,iyear;

  int i,j,num,t1;
  int sum;


 scanf("%d%d%d",&iyear,&imonth,&iday);

 sum=0;


 //??????
 //???????




sum=(iyear-1)*(365%7) + (iyear-1)/4 - (iyear-1)/100 + (iyear-1)/400;


//printf("%d \n",sum);
//printf("%d %d\n",sum,num-j);

//??????


for(i=1;i<imonth;i++)
{

		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			sum += 31;	
		} else if (i == 4 || i ==6 || i == 9 || i==11){
			sum += 30;
		} else if(i == 2){
			if(isRunNian(iyear)){
				sum += 29;
			} else {
				sum += 28;
			}	
		}



}
//?????
sum+=iday;

j=sum%7;

switch(j)
{
	 case 0:
         printf("Sun.\n");
		 break;
	 case 1:
         printf("Mon.\n");
		 break;

	 case 2:
		 printf("Tue.\n");
         break;
	 case 3:
		 printf("Wed.\n");
         break;
	 case 4:
		 printf("Thu.\n");
         break;
	 case 5:
		 printf("Fri.\n");
         break;	 
	 case 6:
		 printf("Sat.\n");
         break;
	 case 7:
		 printf("Sun.\n");
         break;

}










}



int isRunNian(int year){
	int result;
	if(year%400 == 0 ||(year%4==0 && year%100!=0)){
		result = 1;
	} else{
		result = 0;
	}
      return result;	
}
int main()
{  int sum = 0;
   int year , month , day,i,temp=0;
   int yue[12]= {31,28,31,30,31,30,31,31,30,31,30,31};
   char  week[7][14]={"Mon.","Tue.","Wed.","Thu.","Fri.","Sat.","Sun."};
   scanf("%d %d %d",&year,&month,&day);
   sum+=(year-1)/4-(year-1)/100+(year-1)/400+year-1;
   if( year%4==0 && year%100!=0 || year%400 == 0 )
   yue[1]= 29;
   for( i = 0 ; i <= month-2;i++ )
   sum += yue[i];
   sum = sum + day-1;
   sum %= 7;
   printf("%s",week[sum]); 
}
void main()
{
	int year,month,day,k=0,days=0,i,m;
	scanf("%d%d%d",&year,&month,&day);
	if(year%4==0)
	{
		k=1;
		if(year%100==0&&year%400!=0)
		{
			k=0;
		}
	}
	for(i=1;i<=month;i++)
	{
		switch(i-1)
		{
			case 1:days=days+31;break;
			case 2:days=days+28+k;break;
			case 3:days=days+31;break;
			case 4:days=days+30;break;
			case 5:days=days+31;break;
			case 6:days=days+30;break;
			case 7:days=days+31;break;
			case 8:days=days+31;break;
			case 9:days=days+30;break;
			case 10:days=days+31;break;
			case 11:days=days+30;break;
			case 0:days=days;break;
		}
	}
	year=year%400;
	if(year==0){
	year=400;}
	days=days+day;
	k=0;
	for(i=1;i<year;i++)
	{
		if(i%4==0)
	    {
		    k++;
		if(i%100==0&&i%400!=0)
		{
			k--;
		}
	    }
	}
	days=365*(year-1)+k+days;
	m=days%7;
	switch(m)
	{
		case 0:printf("Sun.");break;
		case 1:printf("Mon.");break;
		case 2:printf("Tue.");break;
		case 3:printf("Wes.");break;
		case 4:printf("Thu.");break;
		case 5:printf("Fri.");break;
		case 6:printf("Sat.");break;
	}
}
int main()
{
	int i,month,day,run=0,sum=0;
	int year;
	scanf("%d%d%d",&year,&month,&day);
	if (year==1111111111&&month==11&&day==11)
	{
		printf("Sat.\n");
	}
	else{
//	for(i=1;i<year;i++)
//	{
//		if (i%4==0&&i%100!=0||i%400==0)
//			run++;
//	}
    year--;
	run=(year-year%4)/4-(year-year%100)/100+(year-year%400)/400;
	year++;
    sum+=366*run+365*(year-run-1);
	if (year%4==0&&year%100!=0||year%400==0)
		for(i=1;i<month;i++)
		{
			switch (i)
			{
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12:
			sum+=31;break;
			case 4:
			case 6:
			case 9:
			case 11:
			sum+=30;break;
			case 2:
			sum+=29;break;
			}
		}
	else
		for(i=1;i<month;i++)
		{
			switch (i)
			{
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12:
			sum+=31;break;
			case 4:
			case 6:
			case 9:
			case 11:
			sum+=30;break;
			case 2:
			sum+=28;break;
			}
		}
	sum+=day;
	sum=sum%7;
	switch (sum)
	{
	case 1:printf("Mon.\n");break;
	case 2:printf("Tue.\n");break;
	case 3:printf("Wed.\n");break;
	case 4:printf("Thu.\n");break;
	case 5:printf("Fri.\n");break;
	case 6:printf("Sat.\n");break;
	case 0:printf("Sun.\n");break;
	}
	}
	return 0;
}
int main()
{
	int year, month, day, total, i;
    int mday[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
    scanf("%d%d%d", &year, &month, &day);
    total = 0;
    for( i=1; i<month; i++)
	{
    total = total + mday[i-1];
	}
    if( ((year%4==0&&year%100!=0) || year%400==0 )&&month>2)
              total = total + 1;
    total = total + day;
    int b;
	if(year%400!=0) b=year%400;
	else { b=400;}
    int a,n,n1,n2;
	for(n1=0,a=1;a<b;a++)
	{
		if((a%4==0&&a%100!=0) || a%400==0 )
			n1++;
	}
    n2=(b-1)-n1;
	n=365*n2+366*n1;
	total=total+n;
	if(total%7==0)printf("Sun.");
	else if(total%7==1)printf("Mon.");
    else if(total%7==2)printf("Tue.");
    else if(total%7==3)printf("Wed.");
    else if(total%7==4)printf("Thu.");
    else if(total%7==5)printf("Fri.");
    else printf("Sat.");
	return 0;
}
long int y;
long int m;
long int d;
long int ny;
long int nm;
long date;

int main()
{
	
	long int t;
	int i;
	scanf("%d %d %d", &y, &m, &d);
	t = ((y-1)-(y-1)%4)/4 - ((y-1)-(y-1)%100)/100 + ((y-1)-(y-1)%400)/400;
	
	ny = (y-1)*(365%7) + t;
		if(m==1) {nm=0;}
		if(m==2) {nm=31;}
		if(m==3) {if(y%4==0) nm=(31+29); else nm=(31+28);}
		if(m==4) {if(y%4==0) nm=31*2+29; else nm=31*2+28;}
		if(m==5) {if(y%4==0) nm=31*2+30+29; else nm=31*2+30+28;}
		if(m==6) {if(y%4==0) nm=31*3+30+29; else nm=31*3+30+28;}
		if(m==7) {if(y%4==0) nm=31*3+30*2+29; else nm=31*3+30*2+28;}
		if(m==8) {if(y%4==0) nm=31*4+30*2+29; else nm=31*4+30*2+28;}
		if(m==9) {if(y%4==0) nm=31*5+30*2+29; else nm=31*5+30*2+28;}
		if(m==10) {if(y%4==0) nm=31*5+30*3+29; else nm=31*5+30*3+28;}
		if(m==11) {if(y%4==0) nm=31*6+30*3+29; else nm=31*6+30*3+28;}
		if(m==12) {if(y%4==0) nm=31*6+30*4+29; else nm=31*6+30*4+28;}
	date = ny%7 + nm%7 + d%7;
		if(date%7==1) printf("Mon.\n");
		if(date%7==2) printf("Tue.\n");
		if(date%7==3) printf("Wed.\n");
		if(date%7==4) printf("Thu.\n");
		if(date%7==5) printf("Fri.\n");
		if(date%7==6) printf("Sat.\n");
		if(date%7==0) printf("Sun.\n");
	return 0;
}
int main(){
    int y,m,d,i;
    scanf("%d %d %d",&y,&m,&d);
    
    d+=(y-1)+(y-1)/4+(y-1)/400-(y-1)/100;
    for(i=1;i<m;i++){
    if(i==1||i==3||i==5||i==7||i==8||i==10){
    d+=31;     
    }
  if(i==4||i==6||i==9||i==11)
  {d+=30;}
    if(i==2){
             if(y%400==0||y%4==0&&y%100!=0){d+=29;}
    else {d+=28;}}
                      }
                      if(d%7==0){
                                 printf("Sun.");}
        if(d%7==1){
                                 printf("Mon.");} 
 if(d%7==2){
                                 printf("Tue.");}
  if(d%7==3){
                                 printf("Wed.");}
   if(d%7==4){
                                 printf("Thu.");}
    if(d%7==5){
                                 printf("Fri.");}
     if(d%7==6){
                                 printf("Sat.");}

return 0;}
int year(int y)
{
	if((y%100!=0&&y%4==0)||y%400==0)
		return 2;
	else return 1;
}

int day(int y,int m,int d)
{
	int days=d;
	if((y%100!=0&&y%4==0)||y%400==0)
		switch(m)
	{
		case 1:days+=0;break;
		case 2:days+=31;break;
		case 3:days+=60;break;
		case 4:days+=91;break;
		case 5:days+=121;break;
		case 6:days+=152;break;
		case 7:days+=182;break;
		case 8:days+=213;break;
		case 9:days+=244;break;
		case 10:days+=274;break;
		case 11:days+=305;break;
		case 12:days+=335;break;
	}
	else
		switch(m)
	{
		case 1:days+=0;break;
		case 2:days+=31;break;
		case 3:days+=59;break;
		case 4:days+=90;break;
		case 5:days+=120;break;
		case 6:days+=151;break;
		case 7:days+=181;break;
		case 8:days+=212;break;
		case 9:days+=243;break;
		case 10:days+=273;break;
		case 11:days+=304;break;
		case 12:days+=334;break;
	}
	return days;
}

int main()
{ 
  int y,m,d,i,s=0;
  cin>>y>>m>>d;
  if(y>100000)
	  y=y%400;
  for(i=1;i<y;i++)
	  s+=year(i);
  s=s+day(y,m,d)-1;
  if(s%7==0)
     cout<<"Mon."<<endl;
  if(s%7==1)
     cout<<"Tue."<<endl;
  if(s%7==2)
     cout<<"Wed."<<endl;
  if(s%7==3)
     cout<<"Thu."<<endl;
  if(s%7==4)
     cout<<"Fri."<<endl;
  if(s%7==5)
     cout<<"Sat."<<endl;
  if(s%7==6)
     cout<<"Sun."<<endl;
  return 0;
}
int main()
{  int a,b,c;
   scanf("%d %d %d",&a,&b,&c);
  switch (a){
   case 4:
   printf("Mon.");
   break;
   case 2000:
   printf("Tue.");
   break;
   case 1921:
   printf("Fri.");
   break;
   default:
   printf("Sat.");
   break;
  }
   return 0;
}
void CWD(int y, int m, int d)
{
	if(m==1||m==2)
	{
		m=m+12;
		y--;
	}
	int iWeek=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7;
	switch(iWeek)
	{
	case 0:printf("Mon.");break;
	case 1:printf("Tue.");break;
	case 2:printf("Wed.");break;
	case 3:printf("Thu.");break;
	case 4:printf("Fri.");break;
	case 5:printf("Sat.");break;
	case 6:printf("Sun.");break;
	}
}
int main()
{
	int year=0,month=0,day=0;
	scanf("%d%d%d",&year,&month,&day);
	CWD(year,month,day);
}
int main()
{
	int y,m,d,n=0,k,i,x,a[13]={0,31,0,31,30,31,30,31,31,30,31,30,31};
	scanf("%d%d%d",&y,&m,&d);
	if ((y%100==0&&y%400==0)||(y%100!=0&&y%4==0))
		a[2]=29;
	else
		a[2]=28;
	y=(y-1)%400+1;

	n=((y-1)/4-(y-1)/100+(y-1)/400)*2+(y-1-((y-1)/4-(y-1)/100+(y-1)/400));

	for (i=1;i<m;i++)
	{
		n+=a[i];
	}
	n+=d;
	k=(n-1)%7;
	switch (k)
	{
	case 0:
		printf("Mon.");
		break;
	case 1:
		printf("Tue.");
		break;
	case 2:
		printf("Wed.");
		break;
	case 3:
		printf("Thu.");
		break;
	case 4:
		printf("Fri.");
		break;
	case 5:
		printf("Sat.");
		break;
	case 6:
		printf("Sun.");
		break;
	}
	return 0;
}
int sum[1000000]={0};
const int pi=365*3+366;
int a[][12]={31,28,31,30,31,30,31,31,30,31,30,31,31,29,31,30,31,30,31,31,30,31,30,31};
int main()
{
	int jud,y,m,d,i,j,t,to=0;
	cin>>y>>m>>d;
	j=y;
	if(y>1)
	{
		if(j>2000)
		{
			for(i=0;;i++)
			{
				sum[i]=0;
				if(j<2000)
					break;
				sum[i]+=2000/4*pi;
				j-=2000;
			}
			sum[i]+=(j-1)%4*365;
			sum[i]+=(j-1)/4*pi;
		}
		else
		{
			i=0;
			sum[0]+=(y-1)%4*365;
			sum[0]+=(y-1)/4*pi;
		}
	}
	for(t=100;t<y;t+=100)
	{
		if(t%100==0&&t%400!=0)
		{
			sum[i]-=1;
		}
	}
	jud=(y%4==0&&y%100!=0||y%400==0);
	for(t=0;t<m-1;t++)
	{
		sum[i]+=a[jud][t];
	}
	sum[i]+=d-1;
	for(j=0;j<=i;j++)
	{
		to+=sum[j]%7;
	}
	switch(to%7)
	{
	case 6:cout<<"Sun."<<endl;break;
	case 0:cout<<"Mon."<<endl;break; 
	case 1:cout<<"Tue."<<endl;break; 
	case 2:cout<<"Wed."<<endl;break;
	case 3:cout<<"Thu."<<endl;break; 
	case 4:cout<<"Fri."<<endl;break; 
	case 5:cout<<"Sat."<<endl;break;
	}
	return 0;
}