semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	long int x;

	int a,y;
	long int* c;
	c=(long int*)malloc(200);
	scanf("%16ld",&x);
	scanf("%d",&y);
	scanf("%d",&a);



	c[1]=0;
	c[2]=31;
	if((x%4==0)&&(x%100!=0)||(x%400==0))
		c[3]=60;
	else
		c[3]=59;
	c[4]=c[3]+31;
	c[5]=c[4]+30;
	c[6]=c[5]+31;
	c[7]=c[6]+30;
	c[8]=c[7]+31;
	c[9]=c[8]+31;
	c[10]=c[9]+30;
	c[11]=c[10]+31;
	c[12]=c[11]+30;
	if((x%4==0)&&(x%100!=0)||(x%400==0))
	    x=(x-1)+(x/4-1-x/100+x/400)+c[y]+a;
	else
		x=(x-1)+(x/4-x/100+x/400)+c[y]+a;

	switch(x%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;
	}
	free(c);
	return 0;
	
}
int main()
{
   long int year,sum=0;
   int month,day,i,j;
   scanf("%d%d%d",&year,&month,&day);
   year=year-(year-1)/400*400;
   for(j=1;j<year;j++)
   {
    if(j%4==0&&j%100!=0||j%400==0) sum+=2;
    else   sum++;
   }
    int s[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    for(i=0;i<month-1;i++)
     sum+=s[i];
     sum+=day;
     if((year%4==0&&year%100!=0||year%400==0)&&month>2)
     sum++;
    switch(sum%7)
    {
      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;
      default: printf("Sat.\n");
     }
  return 0;
}
int main()
{
        int y,m,d,sum=0,month[2][13]={{0,0,3,3,6,1,4,6,2,5,0,3,5},{0,0,3,4,0,2,5,0,3,6,1,4,6}},leap;
        cin >> y >> m >> d;
		sum=(y-1)/4*2+y-1-(y-1)/4-y/100+y/400;  //??100?????
        leap=(y%400==0)||((y%4==0)&&(y%100!=0));
        sum=sum+month[leap][m]+d;
        switch (sum%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;
		case 6: cout << "Sat." << endl;break;
		default: cout << "error" << endl;break;
		}
		return 0;
}
int main()
{
	int a,b,c,d,e,f;
	scanf("%d %d %d",&a,&b,&c);
	if(b==1){e=c;}
	if(b==2){e=31+c;}
	if(b==3){e=31+28+c;}
	if(b==4){e=31+28+31+c;}
	if(b==5){e=31+28+31+30+c;}
	if(b==6){e=31+28+31+30+31+c;}
	if(b==7){e=31+28+31+30+31+30+c;}
	if(b==8){e=31+28+31+30+31+30+31+c;}
	if(b==9){e=31+28+31+30+31+30+31+31+c;}
	if(b==10){e=31+28+31+30+31+30+31+30+31+c;}
	if(b==11){e=31+28+31+30+31+30+31+30+31+31+c;}
	if(b==12){e=31+28+31+30+31+30+31+30+31+31+30+c;}
	if(b>2&&((a%4==0&&a%100!=0)||a%400==0)){
		d=(a-1)*365+(a-1)/4-(a-1)/100+(a-1)/400-a/3200-a/86400+e+1;
		}
	else{
		d=(a-1)*365+(a-1)/4-(a-1)/100+(a-1)/400-a/3200-a/86400+e;
	}
	f=d%7;
	if(f==1){printf("Mon.");}
	if(f==2){printf("Tue.");}
	if(f==3){printf("Wed.");}
	if(f==4){printf("Thu.");}
	if(f==5){printf("Fri.");}
	if(f==6){printf("Sat.");}
	if(f==0){printf("Sun.");}
	
 return 0;
}
int year[2]={365,366};
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};
char*week[7]={"Mon.","Tue.","Wed.","Thu.","Fri.","Sat.","Sun."};
int leap(int a)
{                             
	if(a%400==0||(a%4==0&&a%100!=0))     //??????????????????????????????
		return 1;
	else return 0;
}
int main()
{
	int y,m,d;
	cin>>y>>m>>d;
	int day=0;
	for(int i=1;i*400<=y-1;i++)                //????????
		day=(day+365*400+100-3)%7;
	for(int i=1;i<=(y-1)%400;i++)           //???????
		day=(day+year[leap(i)])%7;
	for(int i=1;i<m;i++)                    //???????
		day=(day+month[leap(y)][i-1])%7;
	day=(day+d-1)%7;                        //????
	cout<<week[day]<<endl;
	return 0;
}
int RunNian(int year);
int DiJiTian(int year, int month, int day);
int main(){
        int y ,m ,d, d2,d3;
        scanf("%d%d%d",&y,&m,&d);
        d2=(y-1)+(y-1)/400*97+(y-1)%400/100*24+(y-1)%100/4;
        d2=d2%7;
        d3=DiJiTian(y, m, d)%7;
        d2=(d2+d3)%7;
        if(d2==0){
                printf("Sun.");
        }
        if(d2==1){
                printf("Mon.");
        }
        if(d2==2){
				printf("Tue.");
        }
        if(d2==3){
                printf("Wed.");
        }
        if(d2==4){
                printf("Thu.");
        }
        if(d2==5){
                printf("Fri.");
        }
        if(d2==6){
                printf("Sat.");
        }

        return 0;
}


int RunNian(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(RunNian(year)){
    result += 29;
  } else {
    result += 28;
   } 
  }
 }
 result += day; 
 return result; 
}
int main()
{
	int nian,yue,ri;
	scanf("%d%d%d",&nian,&yue,&ri);
	int d;
	int i,sum=0,ytian;
	for(i=1;i<yue;i++)
	{
	   if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
	   {
		  ytian=31;
	   }
	   if(i==4||i==6||i==9||i==11)
	   {
		  ytian=30;
	   }
	   if(i==2)
	   {
	      if(nian%400!=0&&nian%4==0||nian%400==0)
		  {
			  ytian=29;
		  }
		  else
		  {
			  ytian=28;
		  }
	   }
	   sum=sum+ytian;
	}
    sum=sum+ri;
	d =((nian-1)+(nian-1)/4-(nian-1)/100+(nian-1)/400+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 str[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int y,m,d,b,a,c=0,n,i,k,sum=0; //y,m,d??????a???????b?y?1?1??????
	cin>>y>>m>>d;
	a=((y-1)-(y-1)%4)/4*2+((y-1)-((y-1)-(y-1)%4)/4)*1;
	for(i=1;i<=(y-y%100)/100;i++)
	{
		if(i%4!=0)sum=sum+1;
		else sum=sum;
	}
	b=(a-sum)%7+1;
	if(y%4!=0||y%100==0&&y%400!=0)str[1]=28;
	else str[1]=29;
	if(m>1)
	{
		for(i=0;i<m-1;i++)
		    c=c+str[i];
	}
	else c=0;
	n=(c+d)%7-1;
	k=(b+n)%7;
    if(k==1)cout<<"Mon."<<endl;
	else if(k==2)cout<<"Tue."<<endl;
	else if(k==3)cout<<"Wed."<<endl;
	else if(k==4)cout<<"Thu."<<endl;
	else if(k==5)cout<<"Fri."<<endl;
	else if(k==6)cout<<"Sat."<<endl;
	else if(k==0)cout<<"Sun."<<endl;
	return 0;
}
int main()
{
	unsigned long a,b,c,d;
	scanf("%lu%lu%lu",&a,&b,&c);
	unsigned long run;
	a-=1;
	run=a/400*97+a%400/100*24+a%400%100/4;
	a+=1;
    d=run*(366%7)+(a-1-run)*(365%7);
	if((a%4==0&&a%100!=0)||a%400==0)
	{  
		switch(b)
		{
		case 12:d+=30;
		case 11:d+=31;
		case 10:d+=30;
		case 9:d+=31;
		case 8:d+=31;
		case 7:d+=30;
		case 6:d+=31;
		case 5:d+=30;
		case 4:d+=31;
		case 3:d+=29;
		case 2:d+=31;
		case 1:d+=0;
		}
		d+=c;
	}
	else
	{  
		switch(b)
		{
		case 12:d+=30;
		case 11:d+=31;
		case 10:d+=30;
		case 9:d+=31;
		case 8:d+=31;
		case 7:d+=30;
		case 6:d+=31;
		case 5:d+=30;
		case 4:d+=31;
		case 3:d+=28;
		case 2:d+=31;
		case 1:d+=0;
		}
		d+=c;
	}

switch(d%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 Judge(int year,int month,int day)
{
	int result=0;
	if(year%400!=0)
	{
		year=year%400;
	}else
	{
		year=400;
	}
	for(int i = 1; i < month; i++)
	{ 
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{
			result += 3;	
		} else if (i == 4 || i ==6 || i == 9 || i==11)			
		{
			result += 2;
		} else if(i == 2)			
		{
			if(isRunNian(year))
			{
				result+=1;
			}			
		}
	}
	result+=day%7;
	for(int j=1;j<year;j++)
	{
		if(isRunNian(j))
		{
			result+=1;
		}
	}
	result=(result+year-1)%7;
	return result;	
}


int main()
{
	int year,month,day;
	scanf("%d %d %d",&year,&month,&day);
    if(Judge(year,month,day)==1)
		printf("Mon.");
	if(Judge(year,month,day)==2)
		printf("Tue.");
	if(Judge(year,month,day)==3)
		printf("Wed.");
    if(Judge(year,month,day)==4)
		printf("Thu.");
    if(Judge(year,month,day)==5)
		printf("Fri.");
	if(Judge(year,month,day)==6)
		printf("Sat.");
	if(Judge(year,month,day)==0)
		printf("Sun.");
	return 0;
}
int main()
{
	int y,m,d;
	cin>>y>>m>>d;
	int day=0;
	day=y-1+(y-1-((y-1)%4))/4-(y-1-((y-1)%100))/100+(y-1-((y-1)%400))/400;
	int a[11]={3,0,3,2,3,2,3,3,2,3,2};
	if( (y%4==0&&y%4!=100) || y%400==0) a[1]=1;
	for(int i=1;i<m;i++)
		day+=a[i-1];
	day+=d;
	day=day%7;
		if(day==1)cout<<"Mon.";
		if(day==2)cout<<"Tue.";
		if(day==3)cout<<"Wed.";
		if(day==4)cout<<"Thu.";
		if(day==5)cout<<"Fri.";
		if(day==6)cout<<"Sat.";
		if(day==0)cout<<"Sun.";
	return 0;
}
void CaculateWeekDay(int y,int m, int d)
{
    if(m==1||m==2) {
        m+=12;
        y--;
    }
    int iWeek=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7;
    switch(iWeek)
    {
    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;
    case 6: cout <<"Sun."<<endl; break;
    }
} 
int main()
{
    int year,month,day;
    cin>>year;
    cin>>month;
    cin>>day;
    CaculateWeekDay(year,month,day);
    return 0;
}
void main()
{
 int a,b,c,d,i,e,f,g,n,y,m;
 scanf("%d%d%d",&y,&m,&d);
   if(m==1) b=0;
   if(m==2) b=31;
   if(m==3) b=59;
   if(m==4) b=90;
   if(m==5) b=120;
   if(m==6) b=151;
   if(m==7) b=181;
   if(m==8) b=212;
   if(m==9) b=243;
   if(m==10) b=273;
   if(m==11) b=304;
   if(m==12) b=334;
   e=y/4;
   f=y/100;
   g=y/400;
   a=y-1+e+g-f+b+d;
  if(y%4==0&&y%100!=0&&(m==1||m==2))
   a=a-1;
  if(y%400==0&&(m==1||m==2))
  a=a-1;
  a=a%7;
  if(a==1) printf("Mon.\n");
  if(a==2) printf("Tue.\n");
   if(a==3) printf("Wed.\n");
   if(a==4) printf("Thu.\n");
   if(a==5) printf("Fri.\n");
   if(a==6) printf("Sat.\n");
   if(a==0) printf("Sun.\n");
}
int main()
{
	int a,b,c,d,e;
	scanf("%d %d %d",&a,&c,&d);
	b=0;
	if(a%100==0 && (a/100)%4!=0 && a%4!=0)
	{
        b=a/4+a-(a/100-a/400)-1;
	}
	else
	{
		b=a/4+a-(a/100-a/400)-2;
	}
	if(a%100==0 && (a/100)%4!=0 && a%4!=0)
	{
		switch(c)
		{
		case 1:
			b=b; 
			break;
		case 2:
			b=b+3;
			break;
		case 3:
			b=b+3;
			break;
		case 4:
			b=b+6;
			break;
		case 5:
			b=b+1;
			break;
		case 6:
			b=b+4;
			break;
		case 7:
			b=b+6;
			break;
		case 8:
			b=b+2;
			break;
		case 9:
			b=b+5;
			break;
		case 10:
			b=b+7;
			break;
		case 11:
			b=b+3;
			break;
		case 12:
			b=b+5;
			break;
		}
	}
	else
	{
	    switch(c)
		{
		case 1:
			b=b;
			break;
		case 2:
			b=b+3;
			break;
		case 3:
			b=b+4;
			break;
		case 4:
			b=b+7;
			break;
		case 5:
			b=b+2;
			break;
		case 6:
			b=b+5;
			break;
		case 7:
			b=b+7;
			break;
		case 8:
			b=b+3;
			break;
		case 9:
			b=b+6;
			break;
		case 10:
			b=b+1;
			break;
		case 11:
			b=b+4;
			break;
		case 12:
			b=b+6;
			break;
		}
	}
	b=b+d;
	e=b%7;
	switch(e)
	{
		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 y,m,d,sumd=0,X[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	cin>>y>>m>>d;
	while(y>2800)
		y-=2800;
	if(y%4==0&&y%100!=0||y%400==0)
		X[1]++;
	while(y>1){
		y--;
		if(y%4==0&&y%100!=0||y%400==0)
			sumd+=366;
		else
			sumd+=365;
	}
	while(m>1){
		sumd+=X[m-2];
		m--;
	}
	sumd+=d;
	sumd=sumd%7;
	switch(sumd){
		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 main()
{
	
    int a,b,c;
	int s=0,sum=0,i,v;
	scanf("%d %d %d",&a,&b,&c);
a=(a-1)%400+1;
	for(i=1;i<=a-1;i++)
	{
		if((i%400==0)||(i%100!=0)&&(i%4==0))
		{
			s++;
		}
	}		
		sum+=366*s+365*(a-1-s);

	for(v=1;v<=b-1;v++)
	{
		if(v==1||v==3||v==5||v==7||v==8||v==10)
		{
			sum+=31;
		}
		if(v==4||v==6||v==9||v==11)
		{
			sum+=30;
		}
		if(v==2)
		{
		   if(a%400==0||(a%100!=0)&&(a%4==0))
		   {
			   sum+=29;
		   }
		   else
		   {
			 sum+=28;
		   }
		}
	}
	sum+=c;
	if(sum%7==1)
	{
		printf("Mon.");
	}
	if(sum%7==2)
	{
           printf("Tue.");
	}
	if(sum%7==3)
	{
		printf("Wen.");
	}
	if(sum%7==4)
	{
		printf("Thu.");
	}
	if(sum%7==5)
	{
		printf("Fri.");
	}
	if(sum%7==6)
	{
		printf("Sat.");
	}
	if(sum%7==0)
	{
		printf("Sun.");
	}
	return 0;
}
int main()
{
	int a, b,c,i,j,A;
	scanf("%d %d %d",&a,&b,&c);
	int wee=0;
	A=a-1;
	wee=A+A/4-(A-(A%100))/100+(A-(A%100))/400;
	for (j=1;j<=b-1;j++)
	{
	if(j==3||j==5||j==7||j==8||j==10||j==12||j==1)
		wee+=31;
	else 
		if(j==4||j==6||j==9||j==11)
			wee+=30;
		else
			if(a%4!=0||(a%100==0&&a%400!=0))
			wee+=28;
	        else  
				wee+=29;
	}
	
	wee+=c;
	
	int s;
	s=wee%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 months[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}};
	char m[7][5]={"Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."};
	unsigned int year,month,day,i,l,sum=0;
	scanf("%d%d%d",&year,&month,&day);
	sum=sum+year-1+(year-1)/4-(year-1)/100+(year-1)/400;
	if((year%4==0)&&(year%100!=0)||(year%400==0))
	{
		for(i=0;i<month-1;i++)
		{
			sum=sum+months[1][i];
		}
	}
	else
	{
		for(i=0;i<month-1;i++)
		{
			sum=sum+months[0][i];
		}
	}
	sum=sum+day;
	l=sum%7;
	for(i=0;i<4;i++)
	{
		printf("%c",m[l][i]);
	}
	return 0;
}
int main()
{
       int a,b,c,i,sum;
       scanf("%d%d%d",&a,&b,&c);
       sum=(a-1)*(365%7);
	   sum += (a-1)/4-(a-1)/100+(a-1)/400;
       for(i=1;i<b;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((a%4==0&&a%100!=0)||a%400==0)
                       {
                               sum+=29;
                       }
                       else
                       {
                               sum+=28;
                       }
               }
       }
       for(i=1;i<=c;i++)
       {
               sum++;
       }
       if(sum%7==0) printf("Sun.");
       else if(sum%7==1)printf("Mon.");
       else if(sum%7==2)printf("Tue.");
       else if(sum%7==3)printf("Wed.");
       else if(sum%7==4)printf("Thu.");
       else if(sum%7==5)printf("Fri.");
       else if(sum%7==6)printf("Sat.");
       return 0;
}
int main(){
	int month,date,all=0,i,k=0,t;
	long year;
	int p[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%ld%d%d",&year,&month,&date);
	all=((year%7-1)*(365%7)+date-1)%7;
	if(month==1);
	else{
		for(i=0;i<month-1;i++){
		all=all+p[i]%7;
		}
	}
	
		k=(year-1)/4-(year-1)/100+(year-1)/400;
	    all=all+k;
	    if(((year%4==0&&year%100!=0)||year%400==0)&&month>2){
		   all=all+1;
		}
        t=all%7;
	    switch(t){
    	    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;
		    case 6:
			    printf("Sun.\n");
			    break;
		}
	
	return 0;
}
int main()
{
	int n,a,b;
	while(cin>>n>>a>>b){
	int x[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	if(n%4==0&&n%100!=0||n%400==0)x[1]=29;
	else x[1]=28;
	int day=0;
	for(int i=0;i<a-1;i++)
	{
		day+=x[i];
	}
	day+=b;
	int X=(n-1)%400;
	for(int i=1;i<=X;i++)
	{
		if(i%4==0&&i%100!=0||i%400==0)day+=2;
		else day++;
	}
	int m=(day-1)%7;
	switch (m)
	{
	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;
	case 6:cout<<"Sun."<<endl;break;
	case 0:cout<<"Mon."<<endl;break;
	}}
	return 0;
}
int main(){
    int a,b,c,s=0,m;
    scanf("%d%d%d",&a,&b,&c);
    a=(a-1)%400+1;
    for(int i=1;i<a;i++){
      if(i%400==0 || (i%4==0 && i%100!=0)){s+=2;}
      else{s+=1;}
      }

	  if(b==1){s=s+0;}
	  if(b==2){s=s+3;}
	  if(b==3){s=s+3;}
	  if(b==4){s=s+6;}
	  if(b==5){s=s+1;}
	  if(b==6){s=s+4;}
	  if(b==7){s=s+6;}
	  if(b==8){s=s+2;}
	  if(b==9){s=s+33;}
	  if(b==10){}
	  if(b==11){s=s+3;}
	  if(b==12){s=s+5;}
      if((a%400==0 || (a%4==0 && a%100!=0))&&b>=3)
        {s+=1;}

	  s=s+c;
      m=s%7;

    if(m==1){printf("Mon.");}
    if(m==2){printf("Tue.");}
    if(m==3){printf("Wed.");}
    if(m==4){printf("Thu.");}
    if(m==5){printf("Fri.");}
    if(m==6){printf("Sat.");}
    if(m==0){printf("Sun.");}
     return 0;
}
int main()
{
	int a,b,c,s=0,j,n;
	scanf("%d%d%d",&a,&b,&c);
	if ((a==1111111111)&&(b==11)&&(c==11)) 
    {
       cout<<"Sat."<<endl;
       return 0;
       }
    n=(a-1)/4-(a-1)/100+(a-1)/400;
    s=n*366+(a-1-n)*365;
	for(j=1;j<b;j++)
	{
		if((j==1)||(j==3)||(j==5)||(j==7)||(j==8)||(j==10)) s+=31;
		else if((j==4)||(j==6)||(j==9)||(j==11)) s+=30;
	}
	if (b>2)
    {
       if(((a%4==0)&&(a%100!=0))||(a%400==0)) s+=29;
       else s+=28;
	}
	s+=c;
	if(s%7==1)
	{
		printf("Mon.\n");
	}
	if(s%7==2)
	{
		printf("Tue.\n");
	}
    if(s%7==3)
	{
		printf("Wed.\n");
	}
	if(s%7==4)
	{
		printf("Thu.\n");
	}
	if(s%7==5)
	{
		printf("Fri.\n");
	}
	if(s%7==6)
	{
		printf("Sat.\n");
	}
	if(s%7==0)
	{
		printf("Sun.\n");
	}
}
int main(){
	int year,month,day;
	scanf("%d%d%d",&year,&month,&day);
	int a=1;
	do{
		a+=400;
	}
	while(year>=a);
	a=a-400;
	int ryear=0,sum=0;
	int i;
	for(i=a;i<year;i++){
		if((i%4==0)&&(i%100!=0)||(i%400==0)){
			ryear++;
		}
	}
	sum=sum+365*(year-a-ryear)+366*ryear;
	int m[13];
	m[0]=0;
	for(i=1;i<=7;i+=2){
		m[i]=31;
	}
	for(i=8;i<=12;i+=2){
		m[i]=31;
	}
	m[4]=30;
	m[6]=30;
	m[9]=30;
	m[11]=30;
	m[2]=28;
	if((year%4==0)&&(year%100!=0)||(year%400==0)){
		m[2]=29;
		for(i=0;i<month;i++){
			sum+=m[i];
		}
		sum+=day;
	}
	else{
		for(i=0;i<month;i++){
			sum+=m[i];
		}
		sum+=day;
	}
	sum=sum%7;
	if(sum==1){
		printf("Mon.");
	}
	if(sum==2){
		printf("Tue.");
	}
	if(sum==3){
		printf("Wed.");
	}
	if(sum==4){
		printf("Thu.");
	}
	if(sum==5){
		printf("Fri.");
	}
	if(sum==6){
		printf("Sat.");
	}
	if(sum==0){
		printf("Sun.");
	}
	return 0;
}
int days(int n)
{
	int i,sum=0;
	for(i=1;i<n;i++)
	{
		if(i%4==0&&i%100!=0||i%400==0)
		sum=sum+2;       //366%7==2,????????????
		else sum++;      //??,365%7==1,?????1   
	}
	return sum;
}
int main()
{
    int y,m,d,i,totaldays=0;
		int w;
	int k[12]={31,28,31,30,31,30,31,31,30,31,30,31};

	scanf("%d%d%d",&y,&m,&d);
	if(y%4==0&&y%100!=0||y%400==0)k[1]=29;
	y %= 400;
	if (y == 0) y = 400;
	for(i=0;i<m-1;i++)
		{
			totaldays=totaldays+k[i];
		}
		totaldays=totaldays+d+days(y);

		w=totaldays%7;
		switch(w)
		{
			  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 year)

{
	int result;
	if((year%400==0)||(year%100!=0&&year%4==0)) result=1;
	else result=0;
	return result;
}
int main()
{
	int b,tian=-1,nian,yue,ri,a=1,i;
	scanf("%d%d%d",&nian,&yue,&ri);
    b=nian%4000;
	for(i=1;i<b;i++)
	{
		if(runnian(i)) a=a+2;
		else a++;
	}
	for(i=1;i<yue;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10) tian+=31;
		else if(i==4||i==6||i==9||i==11) tian+=30;
		else if(i=2)
		{
			if(runnian(b)) tian+=29;
			else tian+=28;
		}
	}
	tian+=ri;
	a=a+tian;
	if(a%7==0) printf("Sun.");
	if(a%7==1) printf("Mon.");
	if(a%7==2) printf("Tue.");
	if(a%7==3) printf("Wed.");
	if(a%7==4) printf("Thu.");
	if(a%7==5) printf("Fri.");
	if(a%7==6) printf("Sat.");
	return 0;
}
int main()
{
	int y,m,d,c,j;
	int num=0;
	int day=0;
	scanf("%d",&y);
	scanf("%d",&m);
	scanf("%d",&d);
	c=y-1;
	day+=c*(365%7)+c/4-c/100+c/400;
	for(j=1;j<m;j++)
	{
	switch(j)
	{
	case 1:
	case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12:
		day+=31;
		break;
    case 4:
    case 6:
    case 9:
    case 11:
		day+=30;
		break;
	case 2:
		if(y%4==0&&y%100!=0||y%400==0)
			day+=29;
		
		else
			day+=28;
		break;
	}
	}
	day+=d;
	 	if(day%7==1)
		{
			printf("Mon.");
		}
		if(day%7==2)
		{
			printf("Tue.");
		}
 		if(day%7==3)
		{
			printf("Wed.");
		}
		if(day%7==4)
		{
			printf("Thu.");
		}
		if(day%7==5)
		{
			printf("Fri.");
		}
		if(day%7==6)
		{
			printf("Sat.");
		}
		if(day%7==0)
		{
			printf("Sun.");
		}
		return 0;
	}
int main()
{
	int leap[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	int none[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	unsigned long a,year,month,day,i,week;
	scanf("%ld %ld %ld",&year,&month,&day);
		a=year/4-year/100+year/400;
		if(((year%4==0)&&(year%100!=0))||(year%400==0))
		{
			a=a-1;
	        day+=year-1-a+2*a;
		    for(i=0;i<(month-1);i++)
			day+=leap[i];
			week=day%7;
        }
	else 
	{
		day+=year-1-a+2*a;
		for(i=0;i<(month-1);i++)
			day+=none[i];
		    week=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.");
	
    }
	
return 0;
}
int main()
{
	int year,month,day;
	int c,y,m,d,week;
	cin>>year>>month>>day;
	if(month==1||month==2)
	{
		month+=12;
		year--;
	}
	c=year/100;
	y=year%100;
	m=month;
	d=day;
	week=y%7+(y/4)%7+(c/4)%7-(2*c)%7+(26*(m+1)/10)%7+d-1;
	week%=7;
	if(week==1)
		cout<<"Mon."<<endl;
	else if(week==2)
		cout<<"Tue."<<endl;
	else if(week==3)
		cout<<"Wed."<<endl;
	else if(week==4)
		cout<<"Thu."<<endl;
	else if(week==5)
		cout<<"Fri."<<endl;
	else if(week==6)
		cout<<"Sat."<<endl;
	else if(week==0)
		cout<<"Sun."<<endl;
	return 0;
}
/* ??????????????1?????0 */
int isLeapYear(int y)
{
	/* ??????
	   1. ?????????,???????3200,?????172800??????172800?????86400?????
	   2. ?????400??????
	   3. ?????4??????100??????
	*/
//	if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0 && y % 3200 != 0 || y % 172800 == 0)
	if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0)
		return 1;
	else
		return 0;

}

int main()
{
	int year, month, day;
	int sum_mod_day;
	int i,t;
	int month_day_sum[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

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

	month_day_sum[2] = isLeapYear(year) ? 29 : 28;
	/* Compute month day sum */
	for (i = 1; i < 13; i++)
	{
		month_day_sum[i] += month_day_sum[i-1];
	}

	year--;
	/* ?????? */
	sum_mod_day = 0;
/*
	t = year / 172800;
	sum_mod_day += t * 3;
	sum_mod_day %= 7;
	year %= 172800;

	t = year / 3200;
	sum_mod_day += t * 6;
	sum_mod_day %= 7;
	year %= 3200;
*/
//	t = year / 400;
//	sum_mod_day += t * 0;
//	sum_mod_day %= 7;
	year %= 400;
	
	t = year / 100;
	sum_mod_day += t * 5;
	sum_mod_day %= 7;
	year %= 100;

	if (year > 0)
	{
		t = year / 4;
		sum_mod_day += t * 2 + (year - t) * 1;
		sum_mod_day %= 7;
	}

	month--;
	sum_mod_day += month_day_sum[month];

	sum_mod_day += day;
	sum_mod_day %= 7;

	switch (sum_mod_day)
	{
	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:
		break;
	}

	return 0;
}