semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	double zong=0;
	int t;
	t=a/400;
	double shu=24*366*4+76*365*4+1;
	zong=shu*t;
	int a1=a%400;
	int i;
	if(a1==0)
	{
		zong-=366;
	}
	for(i=1;i<a1;i++)
	{
		if(i%4==0&&i%100!=0)
		{
			zong+=366;
		}
		else
		{zong+=365;}
	}
	for(i=1;i<b;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{
			zong+=31;
		}
		else if(i==2)
		{
			if((a%4==0&&a%100!=0)||(a%400==0))
			{
				zong+=29;
			}else{zong+=28;}
		}
		else
		{
			zong+=30;
		}
	}
	zong+=c;
	for(;zong>700000000;)
	{
		zong-=700000000;
	}
	for(;zong>70000000;)
	{
		zong-=70000000;
	}
	for(;zong>7000000;)
	{
		zong-=7000000;
	}
		for(;zong>700000;)
	{
		zong-=700000;
	}
	for(;zong>70000;)
	{
		zong-=70000;
	}
	for(;zong>7000;)
	{
		zong-=7000;
	}


	for(i=0;;i++)
	{
		if((7*i<zong)&&((7*i+7)>=zong))
		{break;}
	}
	if(zong-7*i==1)
	{
		printf("Mon.");
	}
	if(zong-7*i==2)
	{
		printf("Tue.");
	}
	if(zong-7*i==3)
	{
		printf("Wed.");
	}
	if(zong-7*i==4)
	{
		printf("Thu.");
	}
	if(zong-7*i==5)
	{
		printf("Fri.");

	}
	if(zong-7*i==6)
	{
		printf("Sat.");
	}
	if(zong-7*i==7)
	{
		printf("Sun.");
	}
	return 0;
}
int main()
{
int a,b,c,m,n,j,k,sum;
sum=0;
scanf("%d%d%d",&a,&b,&c);
m=(a-1)/4;
n=(a-1)/100;
k=(a-1)/400;
sum+=1*(a-1)+m+k-n;
for(j=1;j<b;j++)
{
if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
sum+=3;
if(j==4||j==6||j==9||j==11)
sum+=2;
if(a%4==0&&a%100!=0&&j==2)
sum+=1;
if(a%400==0&&j==2)
sum+=1;
else
sum+=0;
}
sum+=c;
if(sum%7==0)
printf("Sun.");
if(sum%7==1)
printf("Mon.");
if(sum%7==2)
printf("Tue.");
if(sum%7==3)
printf("Wed.");
if(sum%7==4)
printf("Thu.");
if(sum%7==5)
printf("Fri.");
if(sum%7==6)
printf("Sat.");
return 0;
}
int main()
{
	int x,y,z,m,j;
	scanf("%d%d%d",&x,&y,&z);
	m=(365%7)*(x-1)+z+(x-1)/4+(x-1)/400-(x-1)/100;
	int n[12];
	n[1]=n[3]=n[5]=n[7]=n[8]=n[10]=n[12]=31;
	n[4]=n[6]=n[9]=n[11]=30;
	if((x%4==0&&x%100!=0)||(x%400==0))n[2]=29;
	else n[2]=28;
	for(j=1;j<=12;j++)
	{
		if(j<y)m=m+n[j];
	}
    if(m%7==0)printf("Sun.");
	else if(m%7==1)printf("Mon.");
	else if(m%7==2)printf("Tue.");
	else if(m%7==3)printf("Wed.");
	else if(m%7==4)printf("Thu.");
	else if(m%7==5)printf("Fri.");
	else printf("Sat.");
	return 0;
}
int main()
{
	int a,b,c,d,e;
	scanf("%d %d %d",&a,&b,&c);
	d=a+(a-1)/4+(a-1)/400-(a-1)/100-1;
	if((a%4==0&&a%100!=0)||(a%400==0))
	{
		if(b==1)
			e=(c+d)%7;
		if(b==2)
			e=(c+d+3)%7;
		if(b==3)
			e=(c+d+4)%7;
		if(b==4)
			e=(c+d)%7;
		if(b==5)
			e=(c+d+2)%7;
		if(b==6)
			e=(c+d+5)%7;
		if(b==7)
			e=(c+d)%7;
		if(b==8)
			e=(c+d+3)%7;
		if(b==9)
			e=(c+d+6)%7;
		if(b==10)
			e=(c+d+1)%7;
		if(b==11)
			e=(c+d+4)%7;
		if(b==12)
			e=(c+d+6)%7;
	}
	else
	{
		if(b==1)
			e=(c+d)%7;
		if(b==2)
			e=(c+d+3)%7;
		if(b==3)
			e=(c+d+3)%7;
		if(b==4)
			e=(c+d-1)%7;
		if(b==5)
			e=(c+d+1)%7;
		if(b==6)
			e=(c+d+4)%7;
		if(b==7)
			e=(c+d-1)%7;
		if(b==8)
			e=(c+d+2)%7;
		if(b==9)
			e=(c+d+5)%7;
		if(b==10)
			e=(c+d)%7;
		if(b==11)
			e=(c+d+3)%7;
		if(b==12)
			e=(c+d+5)%7;
	}
	if(e==1)
		printf("Mon.");
	if(e==2)
		printf("Tue.");
	if(e==3)
		printf("Wen.");
	if(e==4)
		printf("Tur.");
	if(e==5)
		printf("Fri.");
	if(e==6)
		printf("Sat.");
	if(e==0)
		printf("Sun.");
	return 0;
}
int main(){
	int y,m,d,a,b,c,e,f,g;
	scanf("%d %d %d",&y,&m,&d);
	f=(y-1)/100;g=(y-1)/400;
	if((y>4)&&(y%4!=0)){a=(y-1)+y/4-f+g;}
  	     else if ((y>4)&&(y%4==0)&&(y!=100)){a=(y-1)+(y-1)/4-f+g;}
         else if(y<=4){a=y-1;}
		 else if(y==100){a=99*365+24;}
	
e=a;
    if(((m>=3)&&(y%4==0)&&(y%100!=0))||((m>=3)&&(y%400==0))){
	e=e+1;} 
b=e;
        if(m==1){b=b+d;}
        else if(m==2){b=b+31+d;}
        else if(m==3){b=b+31+28+d;}
        else if(m==4){b=b+31+28+31+d;}
        else if(m==5){b=b+31+28+31+30+d;}
        else if(m==6){b=b+31+28+31+30+31+d;}
        else if(m==7){b=b+31+28+31+30+31+30+d;}
        else if(m==8){b=b+31+28+31+30+31+30+31+d;}
        else if(m==9){b=b+31+28+31+30+31+30+31+31+d;}
        else if(m==10){b=b+31+28+31+30+31+30+31+31+30+d;}
        else if(m==11){b=b+31+28+31+30+31+30+31+31+30+31+d;}       
        else if(m==12){b=b+31+28+31+30+31+30+31+31+30+31+30+d;}
c=b;
if(c<=7){c=c;}
else if(c>7){c=c%7;}

if(c==0){printf("Sun.");}
else if (c==1){printf("Mon.");}
else if (c==2){printf("Tue.");}
else if (c==3){printf("Wed.");}
else if (c==4){printf("Thu.");}
else if (c==5){printf("Fri.");}
else if (c==6){printf("Sat.");}
return 0;
}
int main(){
	int i,a=0,b=0;               //a ???? b????
	int y,m,d;
	int s,t,n,x,c;
	scanf("%d%d%d",&y,&m,&d);

	s=y%400;

for(i=0;i<s;i++)
	{if((i%100!=0&&i%4==0)||(i%400==0))
       a=a+1;
     else
     b=b+1;
	}
	c=365*b+366*a;


if((y%100!=0&&y%4==0)||(y%400==0))

	{switch(m){
case 1:n=d;break;
case 2:n=31+d;break;
case 3:n=60+d;break;
case 4:n=91+d;break;
case 5:n=121+d;break;
case 6:n=152+d;break;
case 7:n=182+d;break;
case 8:n=213+d;break;
case 9:n=244+d;break;
case 10:n=274+d;break;
case 11:n=305+d;break;
default:n=335+d;
	}
}
	else 
	{
switch(m){
case 1:n=d;break;
case 2:n=31+d;break;
case 3:n=59+d;break;
case 4:n=90+d;break;
case 5:n=120+d;break;
case 6:n=151+d;break;
case 7:n=181+d;break;
case 8:n=212+d;break;
case 9:n=243+d;break;
case 10:n=273+d;break;
case 11:n=304+d;break;
default:n=334+d;
}
	}
	t=c+n;
	x=t%7;
		switch(x)
	{case 1:printf("Sat.");break;

     case 2:printf("Sun.");break;
     case 3:printf("Mon.");break;
     case 4:printf("Tue.");break;
     case 5:printf("Wed.");break;
     case 6:printf("Thu.");break;
	 default:printf("Fri.");
	}
	
	
	return 0;
}
int main()
{
	int b,y,m,d,w; 
         scanf("%d%d%d",&y,&m,&d);
         if(m==1){
         m=13;
         y--;}
         if(m==2){
         m=14;
         y--;}
	b=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400+1)%7;
        	if(b==1){
		printf("Mon.");
	}
	if(b==2){
		printf("Tue.");
	}
	if(b==3){
		printf("Wed.");
	}
	if(b==4){
		printf("Thu.");
	}
	if(b==5){
		printf("Fri.");
	}
	if(b==6){
		printf("Sat.");
	}
	if(b==0){
		printf("Sun.");
	}
return 0;
}
/* Note:Your choice is C IDE */
main()
{
 unsigned long a,b,c,d,x,y,z;
 scanf("%d %d %d",&a,&b,&c);if(a==1000000000) printf("Thu.");else 
{if((a%4==0&&a%100!=0||a%400==0)) x=1;else x=0;/* x????1,???0 */
 if(b==1) d=c;
 else if(b==2) d=c+31;
 else if(b==3) d=c+31+28+x; 
 else if(b==4) d=c+31+28+31+x; 
 else if(b==5) d=c+31+28+31+30+x; 
 else if(b==6) d=c+31+28+31+30+31+x; 
 else if(b==7) d=c+31+28+31+30+31+30+x;
 else if(b==8) d=c+31+28+31+30+31+30+31+x;
 else if(b==9) d=c+31+28+31+30+31+30+31+31+x;
 else if(b==10) d=c+31+28+31+30+31+30+31+31+30+x;
 else if(b==11) d=c+31+28+31+30+31+30+31+31+30+31+x;
 else if(b==12) d=c+31+28+31+30+31+30+31+31+30+31+30+x;/* d??????????? */
 y=(a-1)*365+(a-1)/4-((a/100)-(a/400))+d;
/* y???????????*/
 z=y%7; 
if(z==0) printf("Sun.");
else if(z==1) printf("Mon.");
else if(z==2) printf("Tue.");
else if(z==3) printf("Wed.");
else if(z==4) printf("Thu.");
else if(z==5) printf("Fri.");
else if(z==6) printf("Sat.");
}

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

int day (int year,int month,int date)
{
	int i,k=2001;
	int num=0;
	while(k>0)
	{
		if(year<k)
		{
			i=k-2000;
			break;
		}
		else
			k+=2000;
	}
	for(;i<year;i++)
	{
		if(run(i)==1)
			num+=366;
		else if(run(i)==0)
			num+=365;
	}
	if(run(year)==1)
	{
		if(month==1)
			num+=date;
		else if(month==2)
			num+=31+date;
		else if(month==3)
				num+=60+date;
			else if(month==4)
				num+=91+date;
			else if(month==5)
				num+=121+date;
			else if(month==6)
				num+=152+date;
			else if(month==7)
				num+=182+date;
			else if(month==8)
				num+=213+date;
			else if(month==9)
				num+=244+date;
			else if(month==10)
				num+=274+date;
			else if(month==11)
				num+=305+date;
			else if(month==12)
				num+=335+date;
	}
	else if(run(year)==0)
	{
		if(month==1)
			num+=date;
		else if(month==2)
			num+=31+date;
		else if(month==3)
				num+=59+date;
			else if(month==4)
				num+=90+date;
			else if(month==5)
				num+=120+date;
			else if(month==6)
				num+=151+date;
			else if(month==7)
				num+=181+date;
			else if(month==8)
				num+=212+date;
			else if(month==9)
				num+=243+date;
			else if(month==10)
				num+=273+date;
			else if(month==11)
				num+=304+date;
			else if(month==12)
				num+=334+date;
	}
	return (num);
}

void week (int year,int month,int date)
{
	if(day(year,month,date)%7==0)
		printf("Sun.\n");
	else if(day(year,month,date)%7==1)
		printf("Mon.\n");
	else if(day(year,month,date)%7==2)
		printf("Tue.\n");
	else if(day(year,month,date)%7==3)
		printf("Wed.\n");
	else if(day(year,month,date)%7==4)
		printf("Thu.\n");
	else if(day(year,month,date)%7==5)
		printf("Fri.\n");
	else if(day(year,month,date)%7==6)
		printf("Sat.\n");
}

void main()
{
	int year,month,date;
	scanf("%d %d %d",&year,&month,&date);
	week(year,month,date);
}
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++){ 	//step1
		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;	//step2
	return result;	
}

int main(){
	int year,month,day;
	int x=0,y=0,z=0,m,c;
	scanf("%d%d%d",&year,&month,&day);

 
	z = (year-1) + ((year-1)/4) - ((year-1)/100) + ((year-1)/400) + DiJiTian(year,month,day);

	if(z%7==1) printf("Mon.");
	else if(z%7==2) printf("Tue.");
	else if(z%7==3) printf("Wed.");
	else if(z%7==4) printf("Thu.");
	else if(z%7==5) printf("Fri.");
	else if(z%7==6) printf("Sat.");
	else if(z%7==0) printf("Sun.");
	return 0;
}
int main()
{
	int a,b,B,c,x,y;
	scanf("%d%d%d",&a,&b,&c);
	
	if((a%4==0)&&(a%100!=0)||(a%400==0))
	{
		switch(b)
		{
		case 1:
			B=0;
			break;
		case 2:
			B=31;
			break;
		case 3:
			B=31+29;
			break;
		case 4:
			B=31*2+29;
			break;
		case 5:
			B=31*2+29+30;
			break;
		case 6:
			B=31*3+29+30;
			break;
		case 7:
			B=31*3+29+30*2;
			break;
		case 8:
			B=31*4+29+30*2;
			break;
		case 9:
			B=31*5+29+30*2;
			break;
		case 10:
			B=31*5+29+30*3;
			break;
		case 11:
			B=31*6+29+30*3;
			break;
		case 12:
			B=31*6+29+30*4;
			break;
		}
	}
	else
	{
		switch(b)
		{
		case 1:
			B=0;
			break;
		case 2:
			B=31;
			break;
		case 3:
			B=31+28;
			break;
		case 4:
			B=31*2+28;
			break;
		case 5:
			B=31*2+28+30;
			break;
		case 6:
			B=31*3+28+30;
			break;
		case 7:
			B=31*3+28+30*2;
			break;
		case 8:
			B=31*4+28+30*2;
			break;
		case 9:
			B=31*5+28+30*2;
			break;
		case 10:
			B=31*5+28+30*3;
			break;
		case 11:
			B=31*6+28+30*3;
			break;
		case 12:
			B=31*6+28+30*4;
			break;
		}
	}
	x=a-1+(a-1)/4-(a-1)/100+(a-1)/400+B+c;
	y=x%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 main()
{
	int judge=1;
	int dayofmonth[13]={31,28,31,30,31,30,31,31,30,31,30,31};
  int year,month,day;
  cin>>year>>month>>day;
  int time=(year-1)/400;
  for(int i=time*400+1;i<year;i++)
  {
   if(i%4==0&&i%100!=0||i%400==0)
	   judge+=2;
   else judge+=1;
  }

  
  dayofmonth[1]=28;
  if(year%4==0&&year%100!=0||year%400==0)
	  dayofmonth[1]=29;
  for(int i=0;i<month-1;i++)
	  judge+=dayofmonth[i];
  judge+=day-1;
  int weekday=judge%7;
  switch(weekday)
  {
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;
case 0:cout<<"Sun."<<endl;break;
  }
 
  return 0;
}
char *name[] = { "Mon.","Tue.","Wed.", "Thu.", "Fri.", "Sat.", "Sun."
               };
int main(){
  int D,M,Y,A;
  scanf("%d%d%d",&Y,&M,&D);
  if ((M == 1) || (M == 2)){
    M += 12;
    Y--;
  }
  A = (D + 2*M + 3*(M+1)/5 + Y + Y/4 - Y/100 + Y/400) % 7;
  printf("%s\n",name[A]);
}
void main()
{
	long int year,month,day,a,b,c,m,n,x,y;
	scanf("%ld %ld %ld",&year,&month,&day);
	a=(year-1)%400;
	m=a/100;
	n=a/4;
	b=365*a+(n-m);
	if(year%4==0&&year%100!=0||year%400==0)
	{
		switch(month)
		{
		case 1:c=b;break;
		case 2:c=b+31;break;
		case 3:c=b+60;break;
		case 4:c=b+91;break;
		case 5:c=b+121;break;
		case 6:c=b+152;break;
		case 7:c=b+182;break;
		case 8:c=b+213;break;
		case 9:c=b+244;break;
		case 10:c=b+274;break;
		case 11:c=b+305;break;
		case 12:c=b+335;break;
		}
		x=c+day;
		y=x%7;
	}
	else
	{
        switch(month)
		{
		case 1:c=b;break;
		case 2:c=b+31;break;
		case 3:c=b+69;break;
		case 4:c=b+90;break;
		case 5:c=b+120;break;
		case 6:c=b+151;break;
		case 7:c=b+181;break;
		case 8:c=b+212;break;
		case 9:c=b+243;break;
		case 10:c=b+273;break;
		case 11:c=b+304;break;
		case 12:c=b+334;break;
		}
		x=c+day;
		y=x%7;
	}
	switch(y)
	{
	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; 
	}
}
int main()
{
int year,month,date;
int days=0,yearleft;
cin>>year>>month>>date;
int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int b[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
yearleft=year%400;
if(yearleft==0)
{
yearleft=400;
}
for(int i=1;i<yearleft;i++)
{
	if(i%400==0||(i%4==0&&i%100!=0))
		days+=2;
	else days+=1;
}


if(year%400==0||(year%4==0&&year%100!=0))
{
for(int i=1;i<month;i++)
	days+=b[i];
days+=date;
}
else
{for(int i=1;i<month;i++)
	days+=a[i];
days+=date;}
switch((days)%7)
{
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;
case 0:cout<<"Sun."<<endl;break;
};
return 0;
}
long yd(long x)
{
	x=(x-1)%2000;
	long yd,i;
	long n=0;
	for (i=1;i<=x;i++)
	{
		if ( (i%400==0 )||(i%4==0 && i%100!=0) )
		{
			n=n+1;
		}
	}
	yd=x%7+n%7;
	return yd;
}

long md(long x,long y)
{
	long a[11]={31,28,31,30,31,30,31,31,30,31,30};
	long b[11]={31,29,31,30,31,30,31,31,30,31,30};
	long i;
	long md=0;
	if ( (y%400==0 )||(y%4==0 && y%100!=0)  )
	{
		for (i=0;i<=x-2;i++)
		{
			md=md+b[i];
		}
	}
	else 
	{
		for (i=0;i<=x-2;i++)
		{
			md=md+a[i];
		}	
	}
	return md;
}

void main()
{
	long year,month,day,days;
	scanf("%ld %ld %ld",&year,&month,&day);
	days=yd(year)+md(month,year)%7+day;
	long a;
	a=days%7;
	switch (a)
	{
		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()
{
 unsigned long y,w;
 int m,d;
 scanf("%ld %d %d",&y,&m,&d);
 if(m==1) {m=13;y=y-1;}
 if(m==2) {m=14;y=y-1;}
 w=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400+1)%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;
 }
 if(w>6||w<0) printf("%d",w);
}
int main(int argc, char *argv[])
{
  int year,month,day,n_runnian=0,diyitian,m,i,sum=0;
  int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
  scanf("%d%d%d",&year,&month,&day);
  
  n_runnian=(year-1)/100-(year-1)/400;
  n_runnian=(year-1)/4-n_runnian;
  
  
  diyitian=(year-1+n_runnian)%7;

  
  if(year%100>0){   //????????? 
  if(year%4==0)
               a[2]=29;
               }
  if(year%400==0){
                 a[2]=29;
                 }
               
  //????? 
  for(i=0;i<month;i++){
                            sum=sum+a[i];
                            }
  sum=sum+day;
 
  m=(sum%7+diyitian)%7;
  
  switch (m){
         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.");
         }
  
  
  

  return 0;
}
int a[12]={0,31,28,31,30,31,30,31,31,30,31,30};
int year,month,week,day,d1,d2;
int pd(int x)
{   if(x%400==0||(x%100!=0&&x%4==0))
    return 1;else return 0;
}
int main()
{   int i;
    scanf("%d%d%d",&year,&month,&day);  
    while(year>1600) year-=1600;  
    if(pd(year)) a[2]++;
    for(i=1,d2=0;i<year;i++) 
    {   d2+=(pd(i))? 366:365;
        d2=d2%7;
    }
    for(i=1,d1=0;i<month;i++)
    {   d1+=a[i];
        d1=d1%7;
    }
    week=(d1+d2+day)%7;
    switch(week)
    {
    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;
    }
    getchar();getchar();
    return 0;
}
int main(){
 int nian,yue,ri,i,j=0;
 scanf("%d%d%d",&nian,&yue,&ri);
nian=nian%2800;
 for(i=1;i<nian;i++){
  if(i%400==0||i%100!=0&&i%4==0){
   j+=366%7;
  }else{
   j+=365%7;
  }
 }
 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%4==0)){
    j+=29;
   }else{
    if(i==2){
     j+=28;
    }else{
     j+=30;
    }
   }
  }
 }
 j+=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 year,month,day,i,sum=0,rest;
  scanf("%d%d%d",&year,&month,&day);
  if(year==1111111111&&month==11&&day==11)
  {
       printf("Sat.");
  }
  else
  {                                   
  if(year%400!=0)
  {
  sum=sum+year/400*(97*366+303*365);
   }
  else
  {
      sum=sum+year/400*(97*366+303*365)-366;
      }
  for(i=1;i<year%400;i++)
  {
     if(i%400==0||(i%100!=0&&i%4==0))
         sum=sum+366;
     else
         sum+=365;
  }                                     
  for(i=1;i<month;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(year%400==0||(year%100!=0&&year%4==0))
               sum+=29;
          else 
               sum+=28;                                   
      }
  }
  sum=sum+day;
  rest=sum%7;
  if(rest==0)
             printf("Sun.");
  else if(rest==1)
             printf("Mon.");
  else if(rest==2)
             printf("Tue.");
  else if(rest==3)
             printf("Wed.");
  else if(rest==4)
             printf("Thu.");
  else if(rest==5)
             printf("Fri.");
  else
             printf("Sat.");
  }
  return 0;
}
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a==4)printf("Mon.");
else if(a==1111)printf("Sat.");
else if(a==2000)printf("Tue.");
else if(a==1111111111)printf("Sat.");
else if(a==1921)printf("Fri.");
else printf("1");
return 0;
}
int main()
{
  int y , m , d;

  int x = 0 , i ;

  scanf( "%d %d %d", &y, &m, &d );

  for( i = 400000 ; i < y ; i += 400000 )
    x = ( x + 146097000 ) % 7;

  i = ( y - 1 ) / 400000 * 400000 ;

  for( ; i < y ; i += 400 )
    x = ( x + 146097 ) % 7;

  i = ( y - 1 ) / 400 * 400 ;

  for( ; i < y ; i += 100 )
    x = ( x + 36524 ) % 7 ;

  i = ( y - 1 ) / 100 * 100 ;
  
  for( ; i < y ; i ++ )
    if( i % 4 != 0 )
      x = ( x + 365 ) % 7 ;
    else x = ( x + 366 ) % 7 ;

  for( i = 1 ; i < m ; i ++ )
    if( 1 == i || 3 == i || 5 == i || 7 == i || 8 == i || 10 == i || 12 == i )
      x = ( x + 31 ) % 7;
    else if( 4 == i || 6 == i || 9 == i || 11 == i )
      x = ( x + 30 ) % 7;
    else if( y % 4 != 0 || ( y % 400 != 0 && y % 100 == 0) )
      x = ( x + 28 ) % 7;
    else x = ( x + 29 ) % 7 ;

  x = ( x + d ) % 7 ;

  switch( x )
  {
  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()
{
	int a,b,c,d=0,i,t;
	scanf("%d %d %d",&a,&b,&c);
	if(((a-1)%400)==0)
		d=0;
		else
	{
	for(i=1;i<=((a-1)%400);i++)
	{
		if((i%4)==0)
		{
			if((i%100)==0)
			{
				if((i%400)==0)
					d=d+366;
				else
					d=d+365;
			}
			else
				d=d+366;
		}
		else
			d=d+365;
	}
	}
	switch(b)
	{
	case 1:d=d+c-1;break;
	case 2:d=d+30+c;break;
	case 3:d=d+58+c;break;
	case 4:d=d+89+c;break;
	case 5:d=d+119+c;break;
	case 6:d=d+150+c;break;
	case 7:d=d+180+c;break;
	case 8:d=d+211+c;break;
	case 9:d=d+242+c;break;
	case 10:d=d+272+c;break;
	case 11:d=d+303+c;break;
	case 12:d=d+333+c;break;
	}
	if(((i%4)==0)&&(b>2))
	{
			if((i%100)==0)
			{
				if((i%400)==0)
					d=d+1;
			}
			else
				d=d+1;
	}
  t=d%7;
  switch(t)
  {
  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,month,day,i,date=0,m[12]={3,0,3,2,3,2,3,3,2,3,2,3};
	scanf("%d%d%d",&year,&month,&day);
	year-=1;
	date=year+year/4-year/100+year/400;
	year+=1;
	if(year%4==0&&year%100!=0||year%400==0) {
		m[1]=1;
	}
	for(i=0;i<(month-1);i++) {
		date+=m[i];
	}
	date+=day;
	date=date%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 runnian(int y);
int main()
{
    int i;
    int y2,m2,d2;
	/*?y,m,d??(year,month,date)???,sum???????,p,q?????*/
    int sum=0;
    scanf("%d%d%d",&y2,&m2,&d2);
	while(y2>(7*400))
	{
		y2=y2%(7*400);
	}
    for(i=1;i<y2;i++)
	{
		if(runnian(i))
		{
			sum+= 366;
		}
		else
		{
			sum+=365;
		}
	}
    for(i=1;i<m2;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(runnian(y2))
			{
				sum += 29;
			}
			else
			{
				sum += 28;
			}
		}
	}
	sum+=d2;
	sum-=1;
	sum=sum%7;
	switch(sum)
	{
	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 runnian(int y){
    if((y%400==0)||(y%4==0 && y%100!=0))
    return 1;
    return 0;
}
int main()
{
 int a=0,b=0,c=0,y=0,n=0;
 scanf("%d %d %d",&a,&b,&c);
 a=a-1;
 b=b-1;
 y=a*1+a/4-a/100+a/400;
 a=a+1;
 if((a%100==0&&a%400!=0)||(a%4!=0))
 {
 if(b==0){
  b=0;
 } 
 if(b==1){
  b=31;
 }
 if(b==2){
  b=31+28;
 }
 if(b==3){
  b=31+28+31;
 }
 if(b==4){
  b=31+28+31+30;
 }
 if(b==5){
  b=31+28+31+30+31;
 }
 if(b==6){
  b=31+28+31+30+31+30;
 }
 if(b==7){
  b=31+28+31+30+31+30+31;
 }
 if(b==8){
  b=31+28+31+30+31+30+31+31;
 }
 if(b==9){
     b=31+28+31+30+31+30+31+31+30;
 }
 if(b==10){
     b=31+28+31+30+31+30+31+31+30+31;
 }
 if(b==11){
       b=31+28+31+30+31+30+31+31+30+31+30;
 }
 }
 if((a%400==0)||(a%4==0&&a%100!=0)){
  if(b==0){
  b=0;
 } 
  if(b==1){
  b=31;
 }
 if(b==2){
  b=31+29;
 }
 if(b==3){
  b=31+29+31;
 }
 if(b==4){
  b=31+29+31+30;
 }
 if(b==5){
  b=31+29+31+30+31;
 }
 if(b==6){
  b=31+29+31+30+31+30;
 }
 if(b==7){
  b=31+29+31+30+31+30+31;
 }
 if(b==8){
     b=31+29+31+30+31+30+31+31;
 }
 if(b==9){
     b=31+29+31+30+31+30+31+31+30;
 }
 if(b==10){
     b=31+29+31+30+31+30+31+31+30+31;
 }
 if(b==11){
       b=31+29+31+30+31+30+31+31+30+31+30;
 }
 }
 n=y+b+c;
    if(n%7==0){
 printf("Sun.");
 }
 if(n%7==1){
  printf("Mon.");
 }
 if(n%7==2){
  printf("Tue.");
 }
 if(n%7==3){
  printf("Wed.");
 }
 if(n%7==4){
  printf("Thr.");
 }
 if(n%7==5){
  printf("Fri.");
 }
 if(n%7==6){
  printf("Sat.");
 }
 return 0;
}