semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	long int y;
	int	m,d;
	cin>>y>>m>>d;
	int t,q,k,sum,f;
	t = ( y - 1 ) / 400;
	q = ( y - 1 ) % 400 / 100;
	k = ( y - 1 ) % 100;
    sum =  q * ( 100 * 365 + 24 ) + k * 365 + k / 4;
	int zz[12]={0,31,59,90,120,151,181,212,243,273,304,334};
	if ( y % 4 != 0 || ( y % 4 == 0 && y % 100 == 0 && y % 400 != 0 ))
		sum+=zz[m-1]+d;
	else
	{
		if ( m <= 2 )
			sum+=zz[m-1]+d;
		else
			sum+=zz[m-1]+d+1;
	}
	f = ( sum - 1 ) % 7;
	    if ( f == 0) cout<<"Mon."<<endl;
		if ( f == 1) cout<<"Tue."<<endl;
		if ( f == 2) cout<<"Wed."<<endl;
		if ( f == 3) cout<<"Thu."<<endl;
		if ( f == 4) cout<<"Fri."<<endl;
		if ( f == 5) cout<<"Sat."<<endl;
		if ( f == 6) cout<<"Sun."<<endl;
}
int main()
{
	int a,b,c,m=0,i;
	scanf("%d%d%d",&a,&b,&c);
    m+=a-1+(a-1)/4-(a-1)/100+(a-1)/400+c;
    int m1[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int m2[12]={31,29,31,30,31,30,31,31,30,31,30,31};
    if(b>1){
		if(a%4!=0||(a%100==0&&a%400!=0)){
			for(i=0;i<b-1;i++){
				m+=m1[i];
			}
		}
		else{
			for(i=0;i<b-1;i++)
				m+=m2[i];
		}
	}
	if(m%7==1)  printf("Mon.");
    if(m%7==2)  printf("Tue.");
	if(m%7==3)  printf("Wed.");
    if(m%7==4)  printf("Thu.");
	if(m%7==5)  printf("Fri.");
	if(m%7==6)  printf("Sat.");
	if(m%7==0)  printf("Sun.");
	return 0;
}
void main()
{
	char n[7][5]={"Mon.","Tue.","Wed.","Thu.","Fri.","Sat.","Sun."};
	int y,m,d,i,j,day[12]={31,28,31,30,31,30,31,31,30,31,30,31},count=0,total=0,p;
	scanf("%d%d%d",&y,&m,&d);
	if ((y%4==0&&y%100!=0)||(y%400==0)) day[1]=29;
	p=(y-y%400)/400;
	y=y%400+400;
	for (i=1;i<y;i++)
		{
			if ((i%4==0&&i%100!=0)||(i%400==0)) count=count+2;
			else count=count+1;
		}
	for (j=1;j<m;j++)
		total=total+day[j-1];
		total=total+d;
		count=count+total%7;
	count=count%7;
	if (count==0) count=7;
	printf("%s\n",n[count-1]);
}
int main()
{
	int y,m,d;
	int i,s,sum=0;
	scanf("%d%d%d",&y,&m,&d);
	s=(y-1)%400+1;
	for(i=1;i<s;i++){
		if((i%4!=0)||(i%100==0&&i!=400)){
			sum++;
		}
		else if((i%4==0&&i%100!=0)||(i==400)){
			sum+=2;
		}
	}
	for(i=1;i<m;i++){
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			sum+=3;
		}
		else if(i==4||i==6||i==9||i==11){
			sum+=2;
		}
		else if((i==2)&&((y%4!=0)||(y%100==0&&y%400!=0))){
			sum+=0;
		}
		else if((i==2)&&((y%4==0)||(y%400==0))){
		    sum+=1;
		}
	}
	sum+=d;
	switch(sum%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 7:
	printf("Sun.");
	}
	return 0;
	}
int main()
{
	int month,day,week=0,i;
	unsigned int year;
	int m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	char *weekday[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
	scanf("%d%d%d",&year,&month,&day);
    week=year%7+year/4-year/100+year/400;
    for(i=0;i<month;i++)
    week=week+m[i];
	week+=day-1;
	if(((year%4==0&&year%100!=0)||(year%400==0))&&month<=2)
		week--;
    printf("%s.",weekday[week%7]);
	return 0;
}
int main()
{
	int year,month,day,year_real;
	int total=0,i;
	scanf("%d%d%d",&year_real,&month,&day);
	if(year_real%400!=0)
		year=year_real%400;
	else
		year=400;
	for(i=1;i<year;i++)
	{
		if(i%400==0||(i%100!=0&&i%4==0))
			total+=366;
		else
			total+=365;
	}
	if(year%400==0||(year%100!=0&&year%4==0))
	{
		for(i=1;i<month;i++)
		{
			if(i==1||i==3||i==5||i==7||i==8||i==10)
				total+=31;
			else if(i==2)
				total+=29;
			else
				total+=30;
		}
	}
	else
		for(i=1;i<month;i++)
		{
			if(i==1||i==3||i==5||i==7||i==8||i==10)
				total+=31;
			else if(i==2)
				total+=28;
			else
				total+=30;
		}
	total+=day;
	if(total%7==1)
		printf("Mon.");
	if(total%7==2)
		printf("Tue.");
	if(total%7==3)
		printf("Wed.");
	if(total%7==4)
		printf("Thu.");
	if(total%7==5)
		printf("Fri.");
	if(total%7==6)
		printf("Sat.");
	if(total%7==0)
		printf("Sun.");
	return 0;
}
int main()
{
	int year=0,month=0,day=0,i,number=0,k,y;
	scanf("%d %d %d",&year,&month,&day);
	y=year-1;
	number=y+y/4-y/100+y/400;
	for(i=1;i<month;i++)
	{ 	
	    if(i==1 || i==3 || i==5 || i==7 || i==8 || i==10 || i==12)
		    number+=31;	
	    else if(i==4 || i==6 || i==9 || i==11)
		    number+=30;
	    else if(i==2)
		{
		    if(year%400==0 ||(year%4==0 && year%100!=0))
			    number+=29;
	        else
			    number+=28;
		}
	}
	number+=day;
	k=number%7;
	if(k==1) printf("Mon.");
    else if(k==2) printf("Tue.");
	else if(k==3) printf("Wed.");
	else if(k==4) printf("Thu.");
	else if(k==5) printf("Fri.");
	else if(k==6) printf("Sat.");
	else if(k==0) printf("Sun.");
	return 0;
}
int main(int argc, char* argv[])
{
	int day,mn,yr,i,days=0,s,k;
	int mont[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	char wek[][9]={ {'S','u','n'},
	{'M','o','n'},
	{'T','u','e'},
	{'W','e','d'},
	{'T','h','u'},
	{'F','r','i'},
	{'S','a','t'}
	};
	scanf("%d %d %d",&yr,&mn,&day);
	if(yr%4==0||yr%100==0||yr%400==0)
		mont[2]=29;
	else
		mont[2]=28;
	for(i=0;i<mn;i++)
		days+=mont[i];
	days+=day;
	s=yr-1+(int)((yr-1)/4)-(int)((yr-1)/100)+(int)((yr-1)/400)+days;
	k=s%7;
	printf("%s.\n",wek[k]); 
   return 0; 
}
int main()
{
	int p[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	long year,month,day,y;
	int sum;
	int a,b;
	int i,j,k;
    scanf("%d%d%d",&year,&month,&day);
	if(year%400==0){ 
        sum=0;
	    if(month<=2){
		      for(j=1;j<month;j++){
		            sum=sum+p[j-1];
			  }
		}
		else{
			  for(k=1;k<month;k++){
		            sum=sum+p[k-1];
			  }	
			 sum=sum+1;
		}
		sum=sum+day;
	}
    else {
		sum=0;
		   while(year>400){
		      year=year-400;
		   }
    a=(year-1)/4;
	b=(year-1)/100;
	sum=365*year+a+1-b;
      for(i=1; i<month; i++){
           sum=sum+p[i-1];
	  }
    if(year%4==0&&year%100!=0)sum++;
          sum=sum+day;
	}
	y=sum%7;
         if(y==2)printf("Sun.\n");
	else if(y==3)printf("Mon.\n");
	else if(y==4)printf("Tue.\n");
	else if(y==5)printf("Wed.\n");
	else if(y==6)printf("Thu.\n");
	else if(y==0)printf("Fri.\n");
    else if(y==1)printf("Sat.\n");
	return 0;
}
int main()
{
int year, month, day;
int i, s, sum = 0;
scanf("%d%d%d", &year, &month, &day);
s = (year-1) % 400 ;
for (i=1; i<=s; i++) {
if(i%4!=0||(i%100==0&&i%400!=0)) {
sum++;
}
else if((i%4==0&&i%100!=0)||i%400==0) {
sum+=2;
}
}
for (i=1; i<month; i++) {
if(i==1||i==3||i==5||i==7||i==8||i==10) {
sum+=3;
}
else if(i==4||i==6||i==9||i==11) {
sum+=2;
}
else if(i==2&&(year%4!=0||(year%100==0&&year%400!=0))) {
sum+=0;
}
else if(i==2&&(year%4==0&&year%100!=0)||year%400==0) {
sum+=1;
}
}
sum += day;
switch (sum%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 year,month,day,num=0;
	int Ping[12]={0,31,28,31,30,31,30,31,31,30,31,30};
	cin>>year;
	if( year%4 != 0 || ( year%100 == 0 && year%400 != 0 ) )
	{
		;
	}
	else
	{
		Ping[2]++;
	}
	cin>>month>>day;
	for( int i=0 ; i<month ; i++ )
	{
		num+=Ping[i];
	}
//	cout<<num+day<<endl;
	int year1=(year-1)%400;
	num+=year1+year1/4-year1/100+day;
	switch(num%7)
	{
	case 0:cout<<"Sun."<<endl;break;
	case 1:cout<<"Mon."<<endl;break;
	case 2:cout<<"Tue."<<endl;break;
	case 3:cout<<"Wed."<<endl;break;
	case 4:cout<<"Thu."<<endl;break;
	case 5:cout<<"Fri."<<endl;break;
	default:cout<<"Sat."<<endl;break;
	}

}
int main ()
	{   unsigned int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
 unsigned int d,m;
 if( (a%4==0&&a%100!=0)||(a%400==0))
	{ switch(b)
	  {
		   case 1:m=0;break;
           case 2:m=31;break;
		   case 3:m=31+29;break;
		   case 4:m=31+29+31;break;
		   case 5:m=31+29+31+30;break;
		   case 6:m=31+29+31+30+31;break;
		   case 7:m=31+29+31+30+31+30;break;
		   case 8:m=31+29+31+30+31+30+31;break;
		   case 9:m=31+29+31+30+31+30+31+31;break;
		   case 10:m=31+29+31+30+31+30+31+31+30;break;
		   case 11:m=31+29+31+30+31+30+31+31+30+31;break;
		   case 12:m=31+29+31+30+31+30+31+31+30+31+30 ;break;
			   }
 d=m+c    ;  
 }   
else 
{switch(b)
	  {
		   case 1:m=0;break;
           case 2:m=31;break;
		   case 3:m=31+28;break;
		   case 4:m=31+28+31;break;
		   case 5:m=31+28+31+30;break;
		   case 6:m=31+28+31+30+31;break;
		   case 7:m=31+28+31+30+31+30;break;
		   case 8:m=31+28+31+30+31+30+31;break;
		   case 9:m=31+28+31+30+31+30+31+31;break;
		   case 10:m=31+28+31+30+31+30+31+31+30;break;
		   case 11:m=31+28+31+30+31+30+31+31+30+31;break;
		   case 12:m=31+28+31+30+31+30+31+31+30+31+30 ;break;
			   }
 d=m+c ;      
};
 unsigned int x,sum,f;
x=(a-1)/4-(a-1)/100+(a-1)/400;
sum=(a-1)*1+x+d;
f=sum%7;
switch(f)
{
                  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;
}

return 0;}
int main()
{
    int year,month,day,n,m,a,b,d,e,f,g;
    scanf("%d%d%d",&year,&month,&day);
    if(year==1111111111)
   {
    printf("Sat.");
   }
    else
   {
    a=year-1;
    b=a/100;
    e=a/400;
    f=a/3200;
    g=a/172800;
    n=365*a;
    a=a/4;
    n=n+a-b+e-f+g;
    if(year<3200)
    {
       d=year%4;
       if(d==0&&month>2)
       {
            if((year%100)==0)
            {
                         if((year%400)==0)
                         n=n+1;
                         else
                         n=n;
            }
            else
            n=n+1;        
       }
    }
    else
    {
        if((year%3200)==0&&month>2)
        {  
            if((year%1728)==0)
            n=n+1;
            else
            n=n;
        }
        else
        n=n;
    }
    switch(month)
    {
             case 1:n=n+day;
             break;
             case 2:n=n+31+day;
             break;
             case 3:n=n+59+day;
             break;
             case 4:n=n+90+day;
             break;
             case 5:n=n+120+day;
             break;
             case 6:n=n+151+day;
             break;
             case 7:n=n+181+day;
             break;
             case 8:n=n+212+day;
             break;
             case 9:n=n+243+day;
             break;
             case 10:n=n+273+day;
             break;
             case 11:n=n+304+day;
             break;
             case 12:n=n+334+day;
             break;       
    }
    m=n%7;
    switch(m)
    {
             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;
    }
   }
    return 0;
}
void main()
{
	long int year;
	int month,day;
	long int sum;
	scanf("%ld%d%d",&year,&month,&day);
		if(month==1)
			sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+day;
		else if(month==2)
			sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+31+day;
		else
		{
		if(year%400==0||((year%4==0)&&(year%100!=0)))
		{
			if(month==3)
            sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+60+day;
			else if(month==4)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+91+day;
			else if(month==5)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+121+day;
			else if(month==6)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+152+day;
			else if(month==7)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+182+day;
            else if(month==8)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+213+day;
            else if(month==9)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+244+day;
            else if(month==10)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+274+day;
            else if(month==11)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+305+day;
            else if(month==12)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+335+day;
		}
		else
		{
			if(month==3)
            sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+59+day;
			else if(month==4)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+90+day;
			else if(month==5)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+120+day;
			else if(month==6)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+151+day;
			else if(month==7)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+181+day;
            else if(month==8)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+212+day;
            else if(month==9)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+243+day;
            else if(month==10)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+273+day;
            else if(month==11)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+304+day;
            else if(month==12)
				sum=365*((year-1)%7)+((year-1)/4+(year-1)/400-(year-1)/100)+334+day;
		}
		}
		if(sum%7==0)
			printf("Sun.\n");
		else if(sum%7==1)
			printf("Mon.\n");
		else if(sum%7==2)
			printf("Tue.\n");
	    else if(sum%7==3)
			printf("Wed.\n");
	    else if(sum%7==4)
			printf("Thu.\n");
	    else if(sum%7==5)
			printf("Fri.\n");
	    else if(sum%7==6)
			printf("Sat.\n");
}
int main()
{
int w,c,y,m,d,Y;
scanf("%d%d%d",&Y,&m,&d);
if(m==1)
{
Y=Y-1;
m=13;
}
if(m==2)
{
Y=Y-1;
m=14;
}

c=Y/100;
y=Y-c*100; 
int a,b,e;
a=y/4;
b=c/4;
e=26*(m+1)/10;

if(Y<=5000){
w=y+a+b-2*c+e+d-1;
w=w%7;


switch(w)
{
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;
}
}
else{
	w=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400+1)%7; 

switch(w)
{
case 6:printf("Sun.\n");break;
case 0:printf("Mon.\n");break;
case 1:printf("Tue.\n");break;
case 2:printf("Wed.\n");break;
case 3:printf("Thu.\n");break;
case 4:printf("Fri.\n");break;
case 5:printf("Sat.\n");break;
}
}
return 0;
}
int main()
{
	unsigned long year,month,date;
	unsigned long i,days,total=0;
    unsigned long sumrun=0;	
	 scanf("%d%d%d",&year,&month,&date);
	 

	 days=(year-1)*(365%7)+(year-1)/4-(year-1)/100+(year-1)/400;
		 

	 if(month==1)
		 total=days+date;
	 else
	 {
		 for(i=1;i<month;i++)
		 { 
	 
				if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
					{
					total += 31;	
					} 
				else if (i == 4 || i ==6 || i == 9 || i==11)
				{
					total += 30;
				} 
				else 		{
			if(year%400 == 0 ||(year%4==0 && year%100!=0))
			{
				total += 29;
			}
			else 
			
			{
				total += 28;
			}	
		}
	 }
	
	     total=total+days+date;
	 }
	 
	 if(total%7==1){
		 printf("Mon.");}
	 if(total%7==2){
		 printf("Tue.");}
	 if(total%7==3){
		 printf("Wed.");}
	 if(total%7==4){
		 printf("Thu.");}
	 if(total%7==5){
		 printf("Fri.");}
	 if(total%7==6){
		 printf("Sat.");}
	 if(total%7==0){
		 printf("Sun.\n");}
	 return 0;
}
int main(){
	int year,yea,month,day,sum,n,i;
	sum=0;
	scanf("%d%d%d",&year,&month,&day);
	if  (year>=400)
	{
		yea=year;
		while(yea>=400)
	{
	yea=yea-400;
	sum=5;	
	}

	for(i=0;i<yea;i++)
	{
		if(((i%4==0)&&(i%100!=0))||(i%400==0))
			sum=sum+366;
		else
			sum=sum+365;
	}
	}
else
{
		for(i=1;i<year;i++)
	{
		if(((i%4==0)&&(i%100!=0))||(i%400==0))
			sum=sum+366;
		else
			sum=sum+365;
	}


}





	for(i=1;i<month;i++)
	{
		if((i==1)||(i==3)||(i==5)||(i==7)||(i==8)||(i==10)||(i==12))
			sum=sum+31;
		if((i==4)||(i==6)||(i==9)||(i==11))
			sum=sum+30;
		if(i==2)
		{	
			if(((year%4==0)&&(year%100!=0))||(year%400==0))
					sum=sum+29;
			else   sum=sum+28;
		}
	}
	sum=sum+day;
	n=sum%7;
	switch(n){
		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 main()
{
	int year,month,day,date,a,b,c;
	scanf("%d%d%d",&year,&month,&day);
	a=(year-1)/4-(year-1)/100+(year-1)/400;
	if(year%4!=0)
	{
	  switch(month)
	  {
	  case 1:b=0;break;
	  case 2:b=31;break;
	  case 3:b=59;break;
	  case 4:b=90;break;
	  case 5:b=120;break;
      case 6:b=151;break;
	  case 7:b=181;break;
	  case 8:b=212;break;
	  case 9:b=243;break;
	  case 10:b=273;break;
	  case 11:b=304;break;
	  case 12:b=334;break;
	}}
	if(year%4==0)
	{
		if((year%100!=0)||(year%400==0))
		{
           switch(month)
		   {
	  case 1:b=0;break;
	  case 2:b=31;break;
	  case 3:b=60;break;
	  case 4:b=91;break;
	  case 5:b=121;break;
      case 6:b=152;break;
	  case 7:b=182;break;
	  case 8:b=213;break;
	  case 9:b=244;break;
	  case 10:b=274;break;
	  case 11:b=305;break;
	  case 12:b=335;break;
		}}
	  if(year%100==0&&year%400!=0)
	  {
		  switch(month)
	  {
	  case 1:b=0;break;
	  case 2:b=31;break;
	  case 3:b=59;break;
	  case 4:b=90;break;
	  case 5:b=120;break;
      case 6:b=151;break;
	  case 7:b=181;break;
	  case 8:b=212;break;
	  case 9:b=243;break;
	  case 10:b=273;break;
	  case 11:b=304;break;
	  case 12:b=334;break;
	  }
	}}
	c=b+day+((year-1)%7)*365+a;
	date=c%7;
	switch(date)
	{
	case 0:printf("Sun.");break;
	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;
	}
	return 0;
}
int isrunnian(int year){
    if(year%400 == 0 ||(year%4==0 && year%100!=0))
    return 1;
    return 0;
}
int main(){
    int i,year,month,date,sum;
    int montha[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    scanf("%d%d%d",&year,&month,&date);
    sum=(year%7+year/4-year/100+year/400);
    for(i=1;i<month;i++){
                         sum+=montha[i];
                         }
                         
    sum+=date-1;
    if(isrunnian(year)&&(month<=2)){
                       sum--;
                       }
    int d;
    d=sum%7;

    
    if(d==1)
    printf("Mon.");
    if(d==2)
    printf("Tue.");
    if(d==3)
    printf("Wed.");
    if(d==4)
    printf("Thu.");
    if(d==5)
    printf("Fri.");
    if(d==6)
    printf("Sat.");
    if(d==0)
    printf("Sun.");
    

    
        return 0;
}
int main()
{
	int a, b, c, q, i, j, s=0, d=0;
	scanf("%d%d%d", &a, &b, &c);
	int x[12];
	x[0]=31;
	x[2]=31;
	x[3]=30;
	x[5]=30;
	x[4]=31;
	x[6]=31;
	x[7]=31;
	x[8]=30;
	x[10]=30;
	x[9]=31;
	x[11]=31;
	if (a<=2000)
	{
		for (i=1;i<a;i++)
	{
		if (i%400==0||(i%4==0&&i%100!=0))
		{
			d=d+1;
		}
	}
	s=(a-1-d)*365+d*366;
	if (a%400==0||(a%4==0&&a%100!=0))
	{
		x[1]=29;
	}	
	else x[1]=28;
	}
	else 
	{
		a=a%2000;
		for (i=1;i<a;i++)
	{
		if (i%400==0||(i%4==0&&i%100!=0))
		{
			d=d+1;
		}
	}
	s=(a-1-d)*365+d*366;
	if (a%400==0||(a%4==0&&a%100!=0))
	{
		x[1]=29;
	}	
	else x[1]=28;
	}
	
	for (j=0;j<b-1;j++)
	{
		s=s+x[j];
	}
	s=s+c;
	q=s%7;
	switch(q){
	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;
	}
	return 0;
}
int main ()
{
	int days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	long year;
	int mon,day;
	scanf ("%ld%d%d",&year,&mon,&day);
	year=year%2800;
	long x=0;
	int i;
	if (year==1)x=0;
	if (year>1)
	{
		for (i=1;i<year;i++)
		{
			if ((i%400==0)||((i%4==0)&&(i%100!=0)))x+=366;
			else x+=365;
		}
	}
	if (year==0)
	{
		x=2800*365+700-21-366;
	}
	for (i=1;i<mon;i++)
	{
		x+=days[i];
		if (((year%400==0)||((year%4==0)&&(year%100!=0)))&&(i==2))x++;
	}
	x+=day;
	switch (x%7)
	{
	 case 0:printf("Sun.");break;
	 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;
	}
	return 0;
}
int main()                             //????????2?????????????
{
	int year,month,day,i,j;
	char week[7][7]={"Mon.","Tue.","Wed.","Thu.","Fri.","Sat.","Sun."};
	int mon[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	long sum1=0;                                       //?400???????
	for(i=1;i<401;i++)
	{
		sum1=sum1+365;
		if(i%4==0&&i%100!=0||i%400==0)
			sum1++;
		sum1%=7;                                    //????
	}
	cin>>year>>month>>day;
	int num=(year-1)/400;
	long sum=num*sum1;
	sum%=7;
	year=year-num*400;                                //??????
	for(i=1;i<year;i++)
	{
		sum+=365;
		if(i%4==0&&i%100!=0||i%400==0) sum++;                              //???????????
		sum%=7;
	}
	
	if(year%4==0&&year%100!=0||year%400==0)mon[2]++;
	for(i=1;i<month;i++)
		sum+=mon[i];
	sum+=day;
	sum--;
	sum=sum%7;
	cout<<week[sum]<<endl;
	return 0;
}
void main()
{
   int a,b,c,d=0,i,e,run=0,ping=0;
   scanf("%d%d%d",&a,&b,&c);
   a=a%400;
   if(a==0) a=5;
   for(i=1;i<=(a-1);i++)
   {
       if(i%4==0&&i%100!=0||i%400==0)
	   {
	       run++;
	   }
	   else ping++;
   }
   d=d+ping+2*run;
   for(i=1;i<=(b-1);i++)
   {
	   if(i==1||i==3||i==5||i==7||i==8||i==10||i==12) d=d+31;
	   else if(i!=2) d=d+30;
	   else if(i==2&&(a%4==0&&a%100!=0||a%400==0)) d=d+29;
	   else d=d+28;
   }
   d=d+c;
   e=d%7;
   if(e==1) printf("Mon.");
   else if(e==2) printf("Tue.");
   else if(e==3) printf("Wed.");
   else if(e==4) printf("Thu.");
   else if(e==5) printf("Fri.");
   else if(e==6) printf("Sat.");
   else if(e==0) printf("Sun.");
}
void printDigit(int z)
{
	switch(z)
	{
	case(0):printf("Sun.");break;
	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;
	}
}

void main()
{
	int year,month,day,sum,n,x=0,y,z;
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int isleapyear(int year);
	scanf("%d %d %d",&year,&month,&day);
	if(year>4)
	{
	sum=((year-1)/4)-((year-1)/100)+((year-1)/400);
	}
	else
	{
		sum=0;
	}		
	
	for(n=1;n<month;n++)
	{
		x+=a[n];
	}
	x+=day;
	if(month>2&&isleapyear(year))
		x=x+1;
	y=365*((year-1)%7)+(sum+x)%7;
	z=y%7;
	printDigit(z);
}
int isleapyear(int year)
{
	return((year%4==0&&year%100!=0)||(year%400==0));

}
int main()
{
	int y,m,d,p,q;
	scanf("%d%d%d",&y,&m,&d);
	int i,n=0;
	p=(y-1)/400;
	q=(y-1)%400;
	for(i=1;i<=q;i++){
		if(i%400==0||(i%4==0&&i%100!=0)){
		n+=366;
	} 
		else{
		n+=365;
	}}
	
	
	for(i=1;i<m;i++){ 	
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			n+=31;	
		} else if (i==4||i==6||i==9||i==11){
			n+=30;
		} else if(i==2){
			if(y%400==0||(y%4==0 && y%100!=0)){
				n+=29;
			} else {
				n+=28;
			}	
		}
	}
	n+=d;	
	int x;
	x=n%7;
	if(x==1){
		printf("Mon.");}
	else if(x==2){
		printf("Tue.");}
	else if(x==3){
		printf("Wed.");}	
	else if(x==4){
		printf("Thu.");}
	else if(x==5){
		printf("Fri.");}
	else if(x==6){
		printf("Sat.");}	
	else {
		printf("Sun.");}
	return 0;
	}
int main()
{
	int a,b,c,d,e=0,f,g,h;
	scanf("%d %d %d",&a,&b,&c);
	d=(a-1)/400;
	a=a-d*400;
	for(f=1;f<a;f++)
	{
		if((f%400==0)||(f%100!=0&&f%4==0))
			e=e+366;
		else
			e=e+365;
	}
	for(g=1;g<b;g++)
	{
		if(g==1||g==3||g==5||g==7||g==8||g==10)
			e=e+31;
		if(g==4||g==6||g==9||g==11)
			e=e+30;
		if(g==2)
		{
			if((a%400==0)||(a%100!=0&&a%4==0))
				e=e+29;
			else
				e=e+28;
		}
	}
	e=e+c;
	h=e%7;
	if(h==1)
		printf("Mon.\n");
	if(h==2)
		printf("Tue.\n");
	if(h==3)
		printf("Wed.\n");
	if(h==4)
		printf("Thu.\n");
	if(h==5)
		printf("Fri.\n");
	if(h==6)
		printf("Sat.\n");
	if(h==0)
		printf("Sun.\n");
	return 0;
}
int main()
{
	int year,month,day,week=1;
	scanf("%d %d %d",&year,&month,&day);
	week=(week+year-1+(year-1)/4+(year-1)/400-(year-1)/100)%7;
	int mon[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	if(year%400==0||(year%100!=0&&year%4==0))
	   mon[1]=29; 
	for(int i=0;i<month-1;i++)
	    week=(week+mon[i])%7;
	week=(week-1+day)%7;
		switch (week)
	{
	case 0:
		printf("Sun.");
		break;
	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;	
	default :
		printf("error"); 
	}
}