semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int leap(int a)
{
	if(a%4!=0)
		return 0;
	else
	{
		if(a%100!=0)
			return 1;
		else
		{
			if(a%400==0)
				return 1;
			else
				return 0;
		}
	}
}

void main()
{
	int y,y0,y1,y2,m,d,sum=0;
	scanf("%d%d%d",&y,&m,&d);
	y0=y-1;
	y0=y0%400;
	if(y>0)
	{	
		y1=y0%4;
		y2=y0/4;
		sum=sum+y2*5+y1-y0/100;
	}
	if(leap(y)==0)
	{
		switch(m)
		{
		case 1:break;
		case 2:sum=sum+3;break;
		case 3:sum=sum+3;break;
		case 4:sum=sum+6;break;
		case 5:sum=sum+1;break;
		case 6:sum=sum+4;break;
		case 7:sum=sum+6;break;
		case 8:sum=sum+2;break;
		case 9:sum=sum+5;break;
		case 10:break;
		case 11:sum=sum+3;break;
		case 12:sum=sum+5;break;
		}
	}
	else
	{
		switch(m)
		{
		case 1:break;
		case 2:sum=sum+3;break;
		case 3:sum=sum+4;break;
		case 4:break;
		case 5:sum=sum+2;break;
		case 6:sum=sum+5;break;
		case 7:break;
		case 8:sum=sum+3;break;
		case 9:sum=sum+6;break;
		case 10:sum=sum+1;break;
		case 11:sum=sum+4;break;
		case 12:sum=sum+6;break;
		}
	}
	sum=sum+d%7;
	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;
	}
}
void main()
{
	int n,m,d,w,i,y;
	long sum;
	char nian[20];
    scanf("%s%d%d",nian,&m,&d);
	n=strlen(nian);
	y=0;
	if(n>5)
		for(i=n-5;i<n;i++)
		   y=y*10+nian[i]-'0';
	else
		for(i=0;i<n;i++)
			y=y*10+nian[i]-'0';
    if(y%400==0||(y%4==0&&y%100!=0))
	{
        sum=365*(y-1)+y/4-y/100+y/400-1;
		if(m==1)
			sum+=0;
		if(m==2)
		    sum+=31;
		if(m>2&&m<=7)
			sum=sum+(m-1)*30+(m-2)/2;
		if(m>=8&&m<=12)
			sum=sum+(m-1)*30+(m-1)/2;
	}
	else
	{
        sum=365*(y-1)+y/4-y/100+y/400;
        if(m==1)
			sum+=0;
		if(m==2)
		    sum+=31;
		if(m>2&&m<=7)
			sum=sum+(m-1)*30+(m-2)/2-1;
		if(m>=8&&m<=12)
			sum=sum+(m-1)*30+(m-1)/2-1;
	}

	sum=sum+d;
	w=sum%7;
	if(w==1)
		printf("Mon.");
    if(w==2)
		printf("Tue.");
	if(w==3)
		printf("Wed.");
	if(w==4)
		printf("Thu.");
	if(w==5)
		printf("Fri.");
    if(w==6)
		printf("Sat.");
	if(w==0)
		printf("Sun.");
}
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;
	}
	
	for(i=1;i<month;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10)
				total+=31;
        else if(i==4||i==6||i==9||i==11)
                total+=30;
		else if(i==2&&(year%400==0||(year%100!=0&&year%4==0)))
				total+=29;
		else
				total+=28;
	}
	
		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 days[] = {    0, 31, 28, 31, 30, 31, 30, 
                31, 31, 30, 31, 30, 31    }; 
    char * weekdays[] =  
        { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; 
 
    int y, m, d, w, i; 
    scanf("%d%d%d", &y, &m, &d); 
 
 w = y % 7 + y / 4 - y / 100 + y / 400; 
 
     for (i = 1; i < m; i++) 
        w += days[i]; 
    w += d - 1; 
 
   
    if (((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) && (m <= 2)) 
        w--; 
    if(w%7==0) printf( "Sun."); 
 if(w%7==1) printf( "Mon."); 
 if(w%7==2) printf( "Tue."); 
 if(w%7==3) printf( "Wed."); 
 if(w%7==4) printf("Thu.");  
 if(w%7==5) printf("Fri.");  
if(w%7==6) printf( "Sat."); 
    return 0; 
}
int main() 
{ 
unsigned int i,w,year,month,day,days=0; 
int mon[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; 
char *week[7]={"Sun.",  "Mon.", "Tue.", "Wed.","Thu.","Fri.","Sat."}; 

scanf("%ld%ld%ld",&year,&month,&day); 
if ((year%4==0)&&(year%100!=0)||(year%400==0)) 
mon[2]=29; 
for (i=0;i<month;i++) 
days=days+mon[i]; 
days=days+day; 
w=year-1+(int)((year-1)/4)-(int)((year-1)/100)+(int)((year-1)/400)+days; 

printf("%s",week[w%7]); 
return 0; 
}
int LpYr(int yr);

int main()
{
    int y,m,d,i;
    int days,dayofwn;
    int daysofm[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    char dayofw[7][5]={"Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."};
    scanf("%d%d%d",&y,&m,&d);
    
    days=(y-1)+(y-1)/4-(y-1)/100+(y-1)/400+d;
    for(i=0;i<m-1;i++)
    {
       days+=daysofm[i];
    }
    if(m>2) days+=LpYr(y);
    dayofwn=days%7;
    printf("%s\n",dayofw[dayofwn]);
    
  return 0;
}

int LpYr(int yr)
{
   return yr%100!=0&&yr%4==0||yr%400==0;
}
void main()
{
unsigned long a,b,c,n,d,D,x;
scanf("%d%d%d",&a,&b,&c);
if((a%4==0&&a%100!=0)||a%400==0)
{
switch(b)
{
case 1: d=0;break;
case 2: d=31;break;
case 3: d=60;break;
case 4: d=91;break;
case 5: d=121;break;
case 6: d=152;break;
case 7: d=182;break;
case 8: d=213;break;
case 9: d=244;break;
case 10: d=274;break;
case 11: d=305;break; 
case 12: d=335;break;
}
n=d+c;
D=(a-1)+a/4-a/100+a/400+n-1;
x=D%7;
}
else
{
switch(b)
{
case 1: d=0;break;
case 2: d=31;break;
case 3: d=59;break;
case 4: d=90;break; 
case 5: d=120;break;
case 6: d=151;break;
case 7: d=181;break;
case 8: d=212;break;
case 9: d=243;break;
case 10: d=273;break;
case 11: d=304;break;
case 12: d=334;break;
}
n=d+c;

D=(a-1)+(a-a%4)/4-(a-a%4)/100+(a-a%4)/400 +n; 
x=D%7;
}
switch(x)
{
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;
}

}
int main()
{
	char week[7][10]={"Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."};
	long int year;
	int i,month,day;
	cin>>year>>month>>day;
	int days[2][12]={{31,29,31,30,31,30,31,31,30,31,30,31},{31,28,31,30,31,30,31,31,30,31,30,31}};
	long int sum=0;
	sum=(year-1)+(year-1)/4-(year-1)/100+(year-1)/400;
	
	if(( (year%400)==0) || ( ((year%4)==0) && ((year%100)!=0) ) ) //???????
		for(i=0;i<month-1;i++)
			sum=sum+days[0][i];
	else 
		for(i=0;i<month-1;i++)
			sum=sum+days[1][i];

	sum=sum+day;  //???????????????????????????1 1 7?sum==1?????sum%7==0??SUN.?
	cout<<week[sum%7]<<endl;
	return 0;
}
int main()
{
	int year,month,day;
	cin>>year>>month>>day;
	int sum=0;
	if (year==1111111111)
	{
		cout<<"Sat."<<endl;
		return 0;
	}
	for (int i=1;i<year;i++)
	{
		if (i%400==0 || (i%4==0 && i%100!=0) )
			sum+=366;
		else sum+=365;
	}
	
	int a[12]={31,0,31,30,31,30,31,31,30,31,30,31};
	if (year%400==0 || (year%4==0 && year%100!=0) )
		a[1]=29;
	else a[1]=28;
	for (int j=0;j<month-1;j++)
	{
		sum+=a[j];
	}
	sum=sum+day;
	int x;
	x=sum%7;
	switch (x)
	{
	case(0):cout<<"Sun."<<endl;break;
	case(1):cout<<"Mon."<<endl;break;
	case(2):cout<<"Tue."<<endl;break;
	case(3):cout<<"Wen."<<endl;break;
	case(4):cout<<"Thu."<<endl;break;
	case(5):cout<<"Fri."<<endl;break;
	default:cout<<"Sat."<<endl;break;
	}
	return 0;
}
int dd[] = {0,0,31,59,90,120,151,181,212,243,273,304,344};

int main()
{
	int y,m,d;
	scanf("%d%d%d",&y,&m,&d);
	
	int l = (y-1)/4-(y-1)/100+(y-1)/400;
	
	
	if(m>2 && y%4==0)
	{
		if(y%100==0)
		{
			if(y%400==0)
				l++;
		}
		else
		{
			l++;
		}
	}
	
	int mod = (((y-1) * (365%7)) % 7 + l + dd[m] + d)%7;
	
	switch(mod)
	{
	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;
}
main()
{
long year,month,day;
long totalday;
int week;
int monthday[12]={0,31,59,90,120,151,181,212,243,273,304,334};
int monthdayLeap[12]={0,31,60,91,121,152,182,213,244,274,305,335};
char * weekname[7]={"Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."};


scanf("%ld %ld %ld",&year,&month,&day);

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

if((year%4==0)&&(year%100!=0)||(year%400==0))
 totalday+=monthdayLeap[month-1];
else
 totalday+=monthday[month-1];

 totalday+=day;

 week=totalday%7;

printf("%s\n",weekname[week]);

}
int runnian(int y);
int lunhun(int y,int m,int d);
int main()
{
	int y,m,d,x;
	scanf("%d%d%d",&y,&m,&d);
	x=lunhun(y,m,d);
	x=x%7;
	switch(x)
	{
	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 lunhun(int y,int m,int d)
{
	int x=0;
	if(y%400!=0)
	{
		y=y%400;
	}
	else
	{
		y=400;
	}
	for(int i=1;i<m;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{
			x+=3;
		}
		else if(i==4||i==6||i==9||i==11)
		{
			x+=2;
		}
		else if(i==2)
		{
			if(runnian(y))
			{
				x+=1;
			}
		}
	}
	x+=d%7;
	for(int j=1;j<y;j++)
	{
		if(runnian(j))
		{
			x+=1;
		}
	}
	x=x+y-1;
	return x;
}

int runnian(int y)
{
	int result;
	if((y%400==0)||(y%4==0&&y%100!=0))
	{
		result=1;
	}
	else
	{
		result=0;
	}
	return result;
}
int isRunNian(int year);
int DiJiTian(int year, int month, int day);
int main(){

	int y,m,d,sum,a,b,i,n=0;
scanf("%d%d%d",&y,&m,&d);
a= DiJiTian(y,m,d);
a=a%7;
y=y%(365*7*400);
for (i=1;i<y;i++){if(isRunNian(i)){n+=1;}}
b=((n*2)%7)+((y-1-n)%7);

sum=a+b;

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

    k=month;
    if(year==1){
		for(;month>1;month--)day+=d[month];
		day=day%7;
	}
	else{
		for(;month>1;month--)day+=d[month];
		day+=year%7-1;
		day=day%7;
		if(k<3)year--;
		a=year/4;
		b=year/100;
		c=year/400;

		day=day+a+c-b;
		
		
        day=day%7;

	}
	
	xingqi=day;
	switch(xingqi){
		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 argc, char* argv[])
{
	int year,day,sum=0,month,n=0,i,j,date;
	int m[12];
	m[0]=31;m[1]=28;m[2]=31;m[3]=30;m[4]=31;m[5]=30;m[6]=m[7]=m[9]=m[11]=31;m[8]=m[10]=30;
    scanf("%d%d%d",&year,&month,&day);
    sum=day;
	for(i=0;i<month-1;i++)
	{
		sum=sum+m[i];
	}
    n=(year-1)/4-(year-1)/100+(year-1)/400;
	sum=n*366+(year-n-1)*365+sum;
	if((month>2)&&(year%400==0||((year%4==0)&&(year%100!=0))))
	{
	sum++;
	}
	date=sum%7;
	if(year==1111111111&&month==11&&day==11)
		printf("Sat.");
	else
	{
	    switch(date)
		{
	    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 panduan(int nian)
{
        if((nian%4==0&&nian%100!=0)||nian%400==0)
                return 1;
        else
                return 0;
}

int main()
{
    
                int year,month,day;
                cin>>year>>month>>day;
                int i;
                long long sum=0;
                if (year==1111111111)
	{
		cout<<"Sat."<<endl;
		return 0;
	}
                for(i=1;i<=year-1;i++)
                {
                        sum+=(365+panduan(i));
                }
                int b[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}};
                for(i=1;i<month;i++)
                {
                        sum+=b[panduan(year)][i];
                }
                sum+=day;
                char q[8][10]={"Sun.","Mon.", "Tue.", "Wed.", "Thu.", "Fri.", "Sat."};
                cout<<q[sum%7];
        return 0;
}
int main()
{
	int x,y,z,m,p,q,r,n,i=1,a[12],k;
    scanf("%d %d %d",&x,&y,&z);
    n=(x-1)%400;
    m=n%100;
    q=n/100;
    p=m%4;
    r=m/4;
    i+=5*q;
    i+=5*r;
    i+=p;
    a[0]=31;
    a[2]=31;
    a[4]=31;
    a[6]=31;
    a[7]=31;
    a[9]=31;
    a[11]=31;
    a[3]=30;
    a[5]=30;
    a[8]=30;
    a[10]=30;
    if(x%400==0||(x%4==0&&x%100!=0))
	{
		a[1]=29;
	}else{
		a[1]=28;
	}
    for(k=0;k<y-1;k++)
	{
		i+=a[k];
	}
    i+=z-1;
    i=i%7;
    switch(i)
	{
    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;
	scanf("%d%d%d",&year,&month,&day);
	int i;int m=0;

    year=year%400 +400;

	m=year-1;
    for(i=1;i<year;i++)
	{if(i%400==0||i%4==0&&i%100!=0)m++;
	}
	
	int days;
	switch(month)
	{
	case 1:days=day;break;
	case 2:days=31+day;break;
    case 3:days=31+28+day;break;
	case 4:days=31+28+31+day;break;
    case 5:days=31+28+31+30+day;break;
    case 6:days=31+28+31+30+31+day;break;
	case 7:days=31+28+31+30+31+30+day;break;
	case 8:days=31+28+31+30+31+30+31+day;break;
	case 9:days=31+28+31+30+31+30+31+31+day;break;
	case 10:days=31+28+31+30+31+30+31+31+30+day;break;
	case 11:days=31+28+31+30+31+30+31+31+30+31+day;break;
	case 12:days=31+28+31+30+31+30+31+31+30+31+30+day;break;

	}
	if((year%400==0||year%4==0&&year%100!=0)&&(month>2))days+=1;
	m+=days%7;
	m=m%7;
	char s[5];
	switch(m)
	{
    case 1:strcpy(s,"Mon.");break;
	case 2:strcpy(s,"Tue.");break;
    case 3:strcpy(s,"Wed.");break;
	case 4:strcpy(s,"Thu.");break;
    case 5:strcpy(s,"Fri.");break;
    case 6:strcpy(s,"Sat.");break;
	case 0:strcpy(s,"Sun.");break;
	}
	printf("%s",s);


	return 0;
}
int main(){
	long int year,month,day,a,b,c=0,i,d[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%ld %ld %ld",&year,&month,&day);
    for(;year>10000;)year=year-10000;
    a=year/4-year/100+year/400;
	if(year%4==0&&year%100!=0||year%400==0){
		a--;
		d[1]++;
	}
    b=(year-1)*365+a+day;
    for(i=0;i<month-1;i++)c+=d[i];
	c+=b;
	int e=c%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 printf("Sun.");
	return 0;
}
int main(){
	int nian,yue,ri,i,j=0,p;
	scanf("%d%d%d",&nian,&yue,&ri);

	if(nian>2800){
		nian%=2800;
	}

	for(i=1;i<nian;i++){
		if((i%400==0)||(i%100!=0&&i%4==0)){
			j++;
	
		
		}
	}
	

	for(i=1;i<yue;i++){
		if((i==1)||(i==3)||(i==5)||(i==7)||(i==8)||(i==10)){
			j+=31;
		
		}else{
			if((i==2)&&((nian%400==0)||(nian%100!=0&&nian%4==0))){
				j+=29;
			
			}else{
				if(i==2){
					j+=28;
			
				}else{
					j+=30;
				}
			}
		}
	}
    
j+=365*(nian-1)+ri;
	j%=7;
	if(j==0){
		printf("Sun.");
	}else{
		if(j==1){
			printf("Mon.");
		}else{
			if(j==2){
				printf("Tue.");
			}else{
				if(j==3){
					printf("Wen.");
				}else{
					if(j==4){
						printf("Thu.");
					}else{
						if(j==5){
							printf("Fri.");
						}else{
							printf("Sat.");
						}
					}
				}
			}
		}
	}

	return 0;
}
int main()
{
	int i,m,n,j,k=0,a,b,c,num=0;
	scanf("%d%d%d",&a,&b,&c);
	m=a/400;
	a=a%400;
	if(a==0)
	{
		num+=5;
	}
	for(i=1;i<a;i++)
	{
		if(i%400==0||(i%4==0&&i%100!=0))
		{
			num+=2;
		}
		else
		{
			num+=1;
		}
	}
	for(j=1;j<b;j++)
	{
		if(j==1||j==3||j==5||j==7||j==8||j==10)
		{
			num+=3;
		}
		if(j==2)
		{
			if(a%400==0||(a%4==0&&a%100!=0))
		{
			num+=1;
		}
		else
		{
			num+=0;
		}
		}
		if(j==4||j==6||j==9||j==11)
		{
			num+=2;
		}
	}
	num+=c;
	k=num%7;
	switch(k)
	{
	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 a, b, c, d, e, f, g, h;
	scanf("%d %d %d", &a, &b, &c);
	while(a>=2800)
		a=a-2800;
	d=a-1;
	e=d*365+(d/4+d/400-d/100);
	if(b==1)
		f=0;
	else if(b==2){
		f=31;}
	else if(b==3){
		if((a%4==0&&a%100!=0)||a%400==0){
			f=60;}
		else{
			f=59;}}
	else if(b==4){
		if((a%4==0&&a%100!=0)||a%400==0){
			f=91;}
		else{
			f=90;}}
	else if(b==5){
		if((a%4==0&&a%100!=0)||a%400==0){
			f=121;}
		else{
			f=120;}}
	else if(b==6){
		if((a%4==0&&a%100!=0)||a%400==0){
			f=152;}
		else{
			f=151;}}
	else if(b==7){
		if((a%4==0&&a%100!=0)||a%400==0){
			f=182;}
		else{
			f=181;}}
	else if(b==8){
		if((a%4==0&&a%100!=0)||a%400==0){
			f=213;}
		else{
			f=212;}}
	else if(b==9){
		if((a%4==0&&a%100!=0)||a%400==0){
			f=244;}
		else{
			f=243;}}
	else if(b==10){
		if((a%4==0&&a%100!=0)||a%400==0){
			f=274;}
		else{
			f=273;}}
	else if(b==11){
		if((a%4==0&&a%100!=0)||a%400==0){
			f=305;}
		else{
			f=304;}}
	else if(b==12){
		if((a%4==0&&a%100!=0)||a%400==0){
			f=335;}
		else{
			f=334;}}
	g=e+f+c;
	h=g%7;
	if(h==1)
		printf("Mon.");
	else if(h==2)
		printf("Tue.");
	else if(h==3)
		printf("Wed.");
	else if(h==4)
		printf("Thu.");
	else if(h==5)
		printf("Fri.");
	else if(h==6)
		printf("Sat.");
	else if(h==0)
		printf("Sun.");
	return 0;
}
//int isrunnian(int year);
int total(int year,int mouth, int day);
int main(){
	int k;
	int p,q;
	int year,mouth, day;
	int sum=0;
	scanf("%d %d %d",&year,&mouth, &day);
	//for(k=1;k<=year-1;k++){
		//if(isrunnian(k)){
	//	if(k%400==0 || (k%4==0&&k%100 != 0) )
	//	{
	//		sum+=2;
	//	}else{
	//		sum+=1;
	//	}
	//}
	sum+=year-1 + (year-1)/4 - (year-1)/100 + (year-1)/400;
	p=total(year, mouth ,day);
	q=p+sum;
	if(q%7==0){
		printf("Sun.\n");
	}
	if(q%7==1){
		printf("Mon.\n");
	}
	if(q%7==2){
		printf("Tue.\n");
	}
	if(q%7==3){
		printf("Wed.\n");
	}
	if(q%7==4){
		printf("Thu.\n");
	}
	if(q%7==5){
		printf("Fri.\n");
	}
	if(q%7==6){
		printf("Sat.\n");
	}
	return 0;
}

















int total(int year, int mouth ,int day){
	int j=0;
	for(int i=1;i<mouth;i++){
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			j+=31;
		}else if (i==4||i==6||i==9||i==11){
			j+=30;
		}
		else if(i==2){
			//if(isrunnian(year)){
			if(year%400 == 0 || (year%4==0&&year%100!=0) )
			{
				j+=29;
			}else {
				j+=28;
			}
		}
	}
	j+=day;
	return j;
}
void main()
{
	int ping[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int run[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	char week[7][5]={"Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."};

	int year,mon,day;
	int result=0;

	//printf("%d\n",(1*366+3*365)%7);

	scanf("%d %d %d",&year,&mon,&day);

	int temp=year;
	year=year-1;

	result+=(year/400)*FOURFUN;
	year=year%400;

	result+=(year/100)*ONEFUN;
	year=year%100;

	result+=(year/20)*TWEN;
	year=year%20;

	result+=(year/4)*FOUR;
	year=year%4;

	result+=ONE*year;

	int flag=0;

	if(temp%400==0)
		flag=1;
	else if(temp%100!=0&&temp%4==0)
		flag=1;

	if(flag==1)
	{
		int i;
		for(i=0;i<mon-1;i++)
			result+=run[i];
		result+=day;
	}
	else
	{
		int i;
		for(i=0;i<mon-1;i++)
			result+=ping[i];
		result+=day;
	}
	result=result%7;

	printf("%s\n",week[result]);
}
main()
{
	int m1[12]={31,28,31,30,31,30,31,31,30,31,30};
	int m2[12]={31,29,31,30,31,30,31,31,30,31,30};
	long int y;
	int i,j,sum=0,m,d;
	char week[8][5]={"Mon.","Tue.","Wed.","Thu.","Fri.","Sat.","Sun."};
	scanf("%ld %d %d",&y,&m,&d);
	if ((y%4==0&&y%100!=0)||(y%400==0))
	{
		for (i=0;i<m-1;i++)
			sum+=m2[i];
		sum+=d-1;
	}
	else
	{
		for (i=0;i<m-1;i++)
			sum+=m1[i];
		sum+=d-1;
	}
	y--;
	sum+=y+y/4-y/100+y/400;
	j=sum%7;
	printf("%s",week[j]);
}
int main ( )
{
	int num = 0, n = 0, year = 0, month = 0, day = 0, i,
		a[12] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	cin >> year >> month >> day;
	if((year % 400 == 0)||((year % 100 != 0)&&(year % 4 == 0)))/*???????*/
		a[1] = 29;
	else a[1] = 28;
	year = (year-1) % 400;/*400??????7???*/
	n = year / 100;
	num += 2 * (year / 4 - n);/*?????????7?2*/
	num += year - (year / 4 - n);
	for(i = 0;i < month-1;i++)
	{
		num += a[i];
	}
	num += day;/*?????*/
	num = num % 7;
	switch(num)/*??????*/
	{
		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;
		case 6:cout << "Sat." <<endl;break;
	}
	return 0;
}
void dayprint(int a){
	switch(a){
	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.");break;
	}
}
int main()
{
	int y,m,d,i,a,sum;
	int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d %d %d",&y,&m,&d);
	sum=y%7+y/4-y/100+y/400;
	if(y%400==0||(y%4==0&&y%100!=0)){
		days[1]=29;
        sum--;
	}
	
	for(i=1;i<m;i++){
		sum+=days[i-1];
	}
	sum+=d-1;
	if(sum%7==0) a=7;
	else a=sum%7;
	dayprint(a);
	return 0;
}