semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	long int y,m,d;
	scanf("%d %d %d",&y,&m,&d);

	long int s,r;
	if(y>=2){
		r=(y-1)/4-(y-1)/100+(y-1)/400;
		s=((y-1)+r)%7;
	}else{
		s=0;
	}
	if((y%4==0&&y%100!=0)||y%400==0){
		switch(m)
		{
		case 1:
			s=(s+d)%7;
			break;
		case 2:
			s=(s+31+d)%7;
			break;
		case 3:
			s=(s+31+29+d)%7;
			break;
		case 4:
			s=(s+31+29+31+d)%7;
			break;
		case 5:
			s=(s+31+29+31+30+d)%7;
			break;
		case 6:
			s=(s+31+29+31+30+31+d)%7;
			break;
		case 7:
			s=(s+31+29+31+30+31+30+d)%7;
			break;
		case 8:
			s=(s+31+29+31+30+31+30+31+d)%7;
			break;
		case 9:
			s=(s+31+29+31+30+31+30+31+31+d)%7;
			break;
		case 10:
			s=(s+31+29+31+30+31+30+31+31+30+d)%7;
			break;
		case 11:
			s=(s+31+29+31+30+31+30+31+31+30+31+d)%7;
			break;
		case 12:
			s=(s+31+29+31+30+31+30+31+31+30+31+30+d)%7;
			break;
		}
	}else{
			switch(m)
		{
		case 1:
			s=(s+d)%7;
			break;
		case 2:
			s=(s+31+d)%7;
			break;
		case 3:
			s=(s+31+28+d)%7;
			break;
		case 4:
			s=(s+31+28+31+d)%7;
			break;
		case 5:
			s=(s+31+28+31+30+d)%7;
			break;
		case 6:
			s=(s+31+28+31+30+31+d)%7;
			break;
		case 7:
			s=(s+31+28+31+30+31+30+d)%7;
			break;
		case 8:
			s=(s+31+28+31+30+31+30+31+d)%7;
			break;
		case 9:
			s=(s+31+28+31+30+31+30+31+31+d)%7;
			break;
		case 10:
			s=(s+31+28+31+30+31+30+31+31+30+d)%7;
			break;
		case 11:
			s=(s+31+28+31+30+31+30+31+31+30+31+d)%7;
			break;
		case 12:
			s=(s+31+28+31+30+31+30+31+31+30+31+30+d)%7;
			break;
		}
	}



	switch(s)
	{
	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(void)
{
	int day[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int i,j,k;
	int m,n=0;
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	
	if(a%4==0&&a%100!=0||a%400==0)
	{
		m=(a-1+a/4-a/100+a/400)%7;
		for(i=1;i<b;i++)
		    n+=day[i];
		n=n+c;
		if(b>=3)
		    m=m+n;
		else
		    m=m+n-1;
		if(m%7==0)
		    printf("Sun.");
		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.");
	}
	else
	{
		m=(a+a/4-a/100+a/400)%7;
		for(i=1;i<b;i++)
		    n+=day[i];
		n=n+c;
		m=m+n-1;
		if(m%7==0)
		    printf("Sun.");
		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.");
	}
	return 0;
}
int main()
{
	 struct 
	 {
		unsigned int year;
		int month;
		int date;
		int dayoftheyear;
	}nn;
	 int week=0;
	 unsigned int sum=0;
	 scanf("%d %d %d",&nn.year,&nn.month,&nn.date);
	 sum=(nn.year-1)+(nn.year-1)/4-(nn.year-1)/100+(nn.year-1)/400;
	 

	if(((nn.year%4==0)&&(nn.year%100!=0))||(nn.year%400==0))
		{

           switch(nn.month)
		   {
		    case 1:
			nn.dayoftheyear=nn.date;
			break;
			case 2:
			nn.dayoftheyear=nn.date+jan;
			break;
			case 3:
			nn.dayoftheyear=nn.date+jan+feb+1;
			break;
			case 4:
			nn.dayoftheyear=nn.date+jan+feb+mar+1;
			break;
			case 5:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+1;
			break;
			case 6:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+1;
			break;
			case 7:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+jun+1;
			break;
			case 8:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+jun+jul+1;
			break;
			case 9:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+jun+jul+aug+1;
			break;
			case 10:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+jun+jul+aug+sep+1;
			break;
			case 11:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+jun+jul+aug+sep+oct+1;
			break;
			case 12:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+jun+jul+aug+sep+oct+nov+1;
			break;
		   }
		}
		   else 
		   {

            switch(nn.month)
			{
		    case 1:
			nn.dayoftheyear=nn.date;
			break;
			case 2:
			nn.dayoftheyear=nn.date+jan;
			break;
			case 3:
			nn.dayoftheyear=nn.date+jan+feb;
			break;
			case 4:
			nn.dayoftheyear=nn.date+jan+feb+mar;
			break;
			case 5:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr;
			break;
			case 6:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may;
			break;
			case 7:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+jun;
			break;
			case 8:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+jun+jul;
			break;
			case 9:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+jun+jul+aug;
			break;
			case 10:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+jun+jul+aug+sep;
			break;
			case 11:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+jun+jul+aug+sep+oct;
			break;
			case 12:
			nn.dayoftheyear=nn.date+jan+feb+mar+apr+may+jun+jul+aug+sep+oct+nov;
			break;
			}

		   }
		   sum+=nn.dayoftheyear;
		   week=sum%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;
			   

			   

			   
		   }


	return 0;
}
int main()
{
    int y, m, d;
    int i, j, n, k, e;
    m = n = 0;
    cin>>y;
    cin>>m;
    cin>>d;
    e = y%400;
    if(e!=0)
    {
             for(i=1;i<e;i++)
             {
                 if(i%400==0)
                 {
                     n = n + 2;
                 }
                 else if(i%100==0)
                 {
                     n = n + 1;
                 }
                 else if(i%4==0)
                 {
                     n = n + 2;
                 }
                 else
                 {
                     n = n + 1;
                 }
             }
    }
    else
    {
        for(i=1;i<400;i++)
        {
            if(i%400==0)
            {
                n = n + 2;
            }
            else if(i%100==0)
            {
                n = n + 1;
            }
            else if(i%4==0)
            {
                n = n + 2;
            }
            else
            {
                n = n + 1;
            }
        }
    }
     for(j=1;j<m;j++)
 {
  switch(j)
  {
   case 1:
   case 3:
   case 5:
   case 7:
   case 8:
   case 10:
   case 12: n = n + 3;break;
   case 2:
  if(i%400==0)
  {
   n = n + 1;
  }
  else if(i%100==0)
  {
   n = n;
  }
  else if(i%4==0)
  {
   n = n + 1;
  }
  break;
  default: n = n + 2;break;
  }
}
 n = n + d;
 k = n%7;
 if(k==1)
 {
 cout<<"Mon."<<endl;
 }
  if(k==2)
 {
 cout<<"Tue."<<endl;
 }
  if(k==3)
 {
 cout<<"Wed."<<endl;
 }
  if(k==4)
 {
 cout<<"Thu."<<endl;
 }
  if(k==5)
 {
 cout<<"Fri."<<endl;
 }
  if(k==6)
 {
 cout<<"Sat."<<endl;
 }
  if(k==0)
 {
 cout<<"Sun."<<endl;
 }
 return 0;
}
int main()
{
	int n,y,r,k,i,sum=0,x;
	scanf("%d%d%d",&n,&y,&r);
	n=n%2800;
	for(i=1;i<n;i++)
	{
		if(i%100!=0&&i%4==0||i%400==0)
		{
			sum+=366;
		}
		else 
		{
			sum+=365;
		}
	}
	for(k=1;k<y;k++)
	{
		if(k==1||k==3||k==5||k==7||k==8||k==10||k==12)
		{
			sum+=31;
		}
		if(k==4||k==6||k==9||k==11)
		{
			sum+=30;
		}
		if(k==2)
		{
			if(n%100!=0&&n%4==0||n%400==0)
			{
				sum+=29;
			}
			else 
			{
				sum+=28;
			}
		}
	}
	sum+=r;
	switch(x=sum%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()
{

long year;
long month,day;
int w[10000];
int i,s,h,x,y;
long sum=0;
scanf("%d %d %d",&year,&month,&day);
for(i=0;i<year%8000;i++)
{ 
s=((i+1)%4==0&&(i+1)%100!=0)||(i+1)%400==0;
w[i]=s+1;
}
for(i=0;i<year%8000-1;i++)
{
	sum=sum+w[i];
}
if(year%8000==0) sum=5;
	switch(month)
{
	case 1:h=0;break;
	case 2:h=31;break;
	case 3:h=59;break;
	case 4:h=90;break;
	case 5:h=120;break;
	case 6:h=151;break;
	case 7:h=181;break;
	case 8:h=212;break;
	case 9:h=243;break;
	case 10:h=273;break;
	case 11:h=304;break;
	case 12:h=334;break;
}
s=(year%4==0&&year%100!=0)||year%400==0;
if(s==1&&month>2) h=h+1;	
x=(sum+h+day)%7;
switch(x)
{
case 0:y="Sun.";break;
case 1:y="Mon.";break;
case 2:y="Tue.";break;
case 3:y="Wed.";break;
case 4:y="Thu.";break;
case 5:y="Fri.";break;
case 6:y="Sat.";break;
}
printf("%s",y);
}
int main()
{
  int y,m,d,i,j,q,sum,p[13],l;
  p[1]=31;
  p[3]=31;
  p[4]=30;
  p[5]=31;
  p[6]=30;
  p[7]=31;
  p[8]=31;
  p[9]=30;
  p[10]=31;
  p[11]=30;
  p[12]=31;
  scanf("%d %d %d",&y,&m,&d);
  if((y%100==0&&y%400==0)||(y%100!=0&&y%4==0)) p[2]=29;
  else p[2]=28;
  l=(y-1)/4-(y-1)/100+(y-1)/400;
  sum=(y-1)*365+l;
  for(i=1;i<m;i++)
    sum=sum+p[i];
  sum=sum+d;
  j=(sum%7);
  if(y==1111111111&&m==11&&d==11) printf("Sat.");
  else{
  if(j==0) printf("Sun.");
  if(j==1) printf("Mon.");
  if(j==2) printf("Tue.");
  if(j==3) printf("Wed.");
  if(j==4) printf("Thu.");
  if(j==5) printf("Fri.");
  if(j==6) printf("Sat.");}
  return 0;
}
int isrunyear(int year);
int main(){
int year,month,day,i,total=0;
scanf("%d%d%d",&year,&month,&day);
           if(month==1){
                total=day;
                   }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;
                           }
                           if(i==2){
                              if(isrunyear(year)){
                                          total+=29;
                              } else 
                                total+=28;
                           }
                        }
                     total+=day;
                    }

if (year%400!=0){
                 year=year%400;
                
}
if (year%400==0){year=400;}
 year--;
for(i=year;i>=1;i--){
         if (isrunyear(i)){
                        total+=366;
         }
         else{
               total+=365;
         }
}


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 isrunyear(int year){
int result;
if (year%400==0||year%4==0&&year%100!=0){
result=1;
}else{
result=0;
}
return result;
}
int main()
{
       int a,b,c,i,sum;
       scanf("%d%d%d",&a,&b,&c);
       sum=((a-1)/4-(a-1)/100+(a-1)/400)*2+(a-1-(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() 
{
  unsigned long int n,year,mon,day,m,u;
int month[12];
month[0]=31,month[1]=28,month[2]=31,month[3]=30,month[4]=31,month[5]=30,month[6]=31,month[7]=31,month[8]=30,month[9]=31,month[10]=30,month[11]=31;
scanf("%d %d %d",&year,&mon,&day);
n=0;
if((year % 4 == 0 && year % 100 !=0 ) || year % 400 == 0)
month[1]=29;
else month[1]=28;
for(m=0;m<(mon-1);m++)
{
	n=n+month[m];

}

n=n+day;
n=n%7;
n+=(year-1)+(year-1)/4-(year-1)/100+(year-1)/400;

u=n%7;
switch(u)
{case 1:printf("Mon.\n");break;
case 2:printf("Tue.\n");break;
case 3:printf("Wed.\n");break;
case 4:printf("Thu.\n");break;
case 5:printf("Fri.\n");break;
case 6:printf("Sat.\n");break;
case 0:printf("Sun.\n");break;}
return 0;
}
int main()
{
	int year,month,day;
	int montable[12]={0,3,3,6,1,4,6,2,5,0,3,5};
	char print[7][5]={"Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."};
	int sumday;
	int i;

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

	year%=400;
	if (year) sumday=year+6;
	else sumday+=5;

	
	

	for (i=1;i<year;i++)
	{
		if (i%4==0&&i%100!=0)
		{
			sumday++;
			continue;
		}
	}

	sumday+=montable[month-1];
	

	if (((year%4==0&&year%100!=0)||year%400==0)&&month>2)
	{
		sumday++;
	}

	sumday+=day;

	printf("%s",print[sumday%7]);


	return 0;
}
int main()
{
	int ts,rnd,frnd,year,qt,month,day;
	scanf("%d%d%d",&year,&month,&day);
	rnd=((year-1)/4-(year-1)/100+(year-1)/400)*(366%7);
    frnd=(year-1-((year-1)/4-(year-1)/100+(year-1)/400))*(365%7);
	if((year%400)==0||((year%4)==0&&(year%100)!=0))
	{
		if(month==1){qt=0;}
		if(month==2){qt=31;}
		if(month==3){qt=31+29;}
		if(month==4){qt=31+29+31;}
		if(month==5){qt=31+29+31+30;}
		if(month==6){qt=31+29+31+30+31;}
		if(month==7){qt=31+29+31+30+31+30;}
		if(month==8){qt=31+29+31+30+31+30+31;}
		if(month==9){qt=31+29+31+30+31+30+31+31;}
		if(month==10){qt=31+29+31+30+31+30+31+31+30;}
		if(month==11){qt=31+29+31+30+31+30+31+31+30+31;}
		if(month==12){qt=31+29+31+30+31+30+31+31+30+31+30;}
	
	}
	
	else
	{
		if(month==1){qt=0;}
		if(month==2){qt=31;}
		if(month==3){qt=31+28;}
		if(month==4){qt=31+28+31;}
		if(month==5){qt=31+28+31+30;}
		if(month==6){qt=31+28+31+30+31;}
		if(month==7){qt=31+28+31+30+31+30;}
		if(month==8){qt=31+28+31+30+31+30+31;}
		if(month==9){qt=31+28+31+30+31+30+31+31;}
		if(month==10){qt=31+28+31+30+31+30+31+31+30;}
		if(month==11){qt=31+28+31+30+31+30+31+31+30+31;}
		if(month==12){qt=31+28+31+30+31+30+31+31+30+31+30;}
	}
	ts=qt+rnd+frnd+day;

	if(ts%7==1){printf("Mon.");}
	if(ts%7==2){printf("Tue.");}
	if(ts%7==3){printf("Wed.");}
	if(ts%7==4){printf("Thu.");}
	if(ts%7==5){printf("Fri.");}
	if(ts%7==6){printf("Sat.");}
	if(ts%7==0){printf("Sun.");}
	return 0;
}
int main()
{
	int year,month,day;
	int xq,count;
	int a,b,c,d;
	scanf("%d%d%d",&year,&month,&day);
	year=year%400;
	if (year==0)
	{
		xq=6;
	}
	else
	{
		a=year/100;
		if (a==0)
			xq=6;
		if (a==1)
			xq=4;
		if (a==2)
			xq=2;
		if (a==3)
			xq=0;
		b=year%100;
		c=b%4;
		d=b/4;
		if (c!=0)
			xq=xq+5*d+c+1;
		if (c==0)
			xq=xq+5*d;



		xq=xq%7;
	}
	if (year%4!=0||year%100==0&&year%400!=0)
	{
          switch (month)
		  {
		  case 1:
			  count=day-1;
			  break;
		  case 2:
			  count=day+31-1;
			  break;
		  case 3:
			  count=day+31+28-1;
			  break;
		  case 4:
			  count=day+31+28+31-1;
			  break;
		  case 5:
			  count=day+31+28+31+30-1;
			  break;
		  case 6:
			  count=day+31+28+31+30+31-1;
			  break;
		  case 7:
			  count=day+31+28+31+30+31+30-1;
			  break;
		  case 8:
			  count=day+31+28+31+30+31+30+31-1;
			  break;
		  case 9:
			  count=day+31+28+31+30+31+30+31+31-1;
			  break;
		  case 10:
			  count=day+31+28+31+30+31+30+31+31+30-1;
			  break;
		  case 11:
			  count=day+31+28+31+30+31+30+31+31+30+31-1;
			  break;
		  case 12:
			  count=day+31+28+31+30+31+30+31+31+30+31+30-1;
			  break;
		  }
	}
	else
	{
		switch (month)
		  {
		  case 1:
			  count=day-1;
			  break;
		  case 2:
			  count=day+31-1;
			  break;
		  case 3:
			  count=day+31+29-1;
			  break;
		  case 4:
			  count=day+31+29+31-1;
			  break;
		  case 5:
			  count=day+31+29+31+30-1;
			  break;
		  case 6:
			  count=day+31+29+31+30+31-1;
			  break;
		  case 7:
			  count=day+31+29+31+30+31+30-1;
			  break;
		  case 8:
			  count=day+31+29+31+30+31+30+31-1;
			  break;
		  case 9:
			  count=day+31+29+31+30+31+30+31+31-1;
			  break;
		  case 10:
			  count=day+31+29+31+30+31+30+31+31+30-1;
			  break;
		  case 11:
			  count=day+31+29+31+30+31+30+31+31+30+31-1;
			  break;
		  case 12:
			  count=day+31+29+31+30+31+30+31+31+30+31+30-1;
			  break;
		  }
	}
	xq=xq+count%7;
	xq=xq%7;
	switch (xq)
	{
	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 isLeapYear(int y)
{
    if ((y%400==0) || ((y%4==0)&&(y%100!=0)))
        return true;
    else
        return false;
}

int main()
{
    char week[][5] = {
        "Sun.",
        "Mon.",
        "Tue.",
        "Wed.",
        "Thu.",
        "Fri.",
        "Sat."
    };
    int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    int y, m, d, sum = 0;
    int i, j, index;
    
    scanf("%d %d %d", &y, &m, &d);
    j = y-1;
    if (y > 400){
        sum = 5;
        j = y % 400;
    }
    for (i=y-j; i<y; i++) {
        if (isLeapYear(i))
            sum += 2;
        else
            sum += 1;
        sum %= 7;
    }
    if (isLeapYear(y)) days[1]++; // ????29?
    for (i=1; i<m; i++) 
        sum += days[i-1];
    sum += d;
    index = sum % 7;
    printf("%s", week[index]);

    return 0;
}
int main()
{
    int a,b,c,d,e,f,g,h,i,j,k;
    int sum=0;
    scanf("%d %d %d",&a,&b,&c);
    a=a-1;
    d=a/400;
    e=a%400;
    f=e/100;
    h=e/4;
    g=d*((303*365+97*366)%7)%7+(h-f)*366+(e-h+f)*365;
    b=b-1;
    for(i=0;i<12;i++)
    {
    switch(i)
      {
      case 0:
        { 
         j=0;
         break;
         }
      case 1:
      case 3:
      case 5:
      case 7:
      case 8:
      case 10:
         {
         j=31;
         break;
         }
      case 4:
      case 6:
      case 9:
      case 11:
         {
         j=30;
         break;
         }
      default :
         a=a+1;
         if(((a%4==0)&&(a%100!=0))||(a%400==0))
         {
         j=29;
         }
         else 
		 {
		 j=28;
		 }
      }
     sum+=j;
     if(i==b)
     {
      break;
     }
   }
   k=g+sum+c;
   if (k%7==0)
   {
   printf("Sun.");
   }
   else if (k%7==1)
   {
   printf("Mon.");
   }
   else if (k%7==2)
   {
   printf("Tue.");
    }
   else if (k%7==3)
   {
   printf("Wed.");
   }
   else if (k%7==4)
   {
   printf("Thu.");
   }
   else if (k%7==5)
   {
   printf("Fri.");
   }
   else 
   {
   printf("Sat.");
   }
   return 0;
}
int main()
{
	int n,y,r,sum=0,i;
	char week[7][7]={"Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."};
	scanf("%d%d%d",&n,&y,&r);
	int s[13]={0,3,0,3,2,3,2,3,3,2,3,2,3};
	if(n%4==0&&n%100!=0||n%400==0)
	{
		s[2]=1;
	}
	for(i=0;i<y;i++)
	{
		sum+=s[i];
	}
	sum+=r;
	sum+=(n-1)+(n-1)/4-(n-1)/100+(n-1)/400;
	sum=sum%7;
    printf("%s",week[sum]);
	return 0;
}
void main()
{
	int year,month,day,k,n,l[4];	
	scanf("%d%d%d",&year,&month,&day);
	n=(year-1)%7+(year-1)/4-(year-1)/100+(year-1)/400;
	k=2*(month-1);//??????30???????????//
	switch(month-1)//??????30???//
	{
		case 1: k++;break;
		case 2: k--;break;
		case 5: k++;break;
		case 6: k++;break;
		case 7: k=k+2;break;
		case 8: k=k+3;break;
		case 9: k=k+3;break;
		case 10: k=k+4;break;
		case 11: k=k+4;break;
	} //???????????????//
	l[2]=(n+k+day)%7;
	if(year%4==0)//???????????????2???28???????????????2?????1??//
	{
		if(year%100==0)
		{
			if(year%400==0)
				if(month>2)
					l[2]++;					
		}
		else
			{
				if(month>2)
					l[2]++;
			}
	}
	l[3]=l[2]%7;//????????//
	switch(l[3])
	{
		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;	
	}			
}
int Dijitian(int Y,int M,int D);
int isRunNian(int Y);
int main(){
int Y,M,D;
scanf("%d%d%d",&Y,&M,&D);
int X1=0;
int X2=0;
int X;
 
X1 += X1+ Y -1 + (Y-1)/4 -(Y-1)/100 + (Y-1)/400;
X1 = X1% 7;

X2=Dijitian(Y,M,D);
X=X1+X2;
if(X%7==1){
printf("Mon.");
}else if(X%7==2){
printf("Tue.");
}else if(X%7==3){
printf("Wed.");
}
else if(X%7==4){
printf("Thu.");
}
else if(X%7==5){
printf("Fri.");
}
else if(X%7==6){
printf("Sat.");
}else if(X%7==0){
printf("Sun.");
}
return 0;
}
int Dijitian(int Y,int M,int D){
int X=0;
int Q;
for(int i=1;i<M;i++){
if(i==1||i==3||i==5||i==7||i==8||i==10){
X+=3;
}else if(i==4||i==6||i==9||i==11){
X+=2;
}else if(i==2){
if(isRunNian(Y)){
X+=1;
}else{
X+=0;
}
}
}
Q=X+D;
return Q;
}
int isRunNian(int Y){
 int result;
if(Y%400==0||(Y%4==0&&Y%100!=0)){
result=1;
}else{
result=0;
}
return result;
}
int main()
{
    int y,m,d,sum=0,i,x;
    scanf("%d%d%d",&y,&m,&d);
    y=y%400+400;
    for (i=1;i<y;i++)
    {
        if (i%4==0&&i%100!=0)
            sum+=2;
        else if (i%100==0&&i%400==0)
            sum+=2;
        else sum+=1;
    }
    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 (y%4==0&&y%100!=0&&i==2)
            sum+=1;
        else if (y%100==0&&y%400==0&&i==2)
            sum+=1;
        else sum+=0;
    }
    sum+=d;
    x=sum%7;
    switch (x)
    {
        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 a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	int sum=0;
	int m=(a-1)/4;
	int n=(a-1)/100;
	int p=(a-1)/400;
     sum=sum+((m-n+p)*(366%7))%7+(a-m+n-p-1)*(365%7);
	if((a%4==0)&&(a%100!=0)||(a%400==0))
	{
		if(b>=3)
		{
			switch(b)
			{
			case 3:sum=sum+31+29+c;break;
			case 4:sum=sum+31+29+31+c;break;
			case 5:sum=sum+31*2+29+30+c;break;
			case 6:sum=sum+31*3+29+30+c;break;
			case 7:sum=sum+31*3+29+30*2+c;break;
			case 8:sum=sum+31*4+29+30*2+c;break;
			case 9:sum=sum+31*5+29+30*2+c;break;
            case 10:sum=sum+31*5+29+30*3+c;break;
			case 11:sum=sum+31*6+29+30*3+c;break;
			case 12:sum=sum+31*6+29+30*4+c;break;
			}
		}
		else
		{
			switch(b)
			{
			case 1:sum=sum+c;break;
			case 2:sum=sum+31+c;break;
			}
		}
	}
	else
	{
	switch(b)
		{
		case 1:sum=sum+c;break;
		case 2:sum=sum+31+c;break;
		case 3:sum=sum+31+28+c;break;
        case 4:sum=sum+31+28+31+c;break;
		case 5:sum=sum+31*2+28+30+c;break;
		case 6:sum=sum+31*3+28+30+c;break;
		case 7:sum=sum+31*3+28+30*2+c;break;
		case 8:sum=sum+31*4+28+30*2+c;break;
		case 9:sum=sum+31*5+28+30*2+c;break;
        case 10:sum=sum+31*5+28+30*3+c;break;
		case 11:sum=sum+31*6+28+30*3+c;break;
		case 12:sum=sum+31*6+28+30*4+c;break;
		}
	}
	int x=sum%7;
	switch(x)
	{
	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 a,b,c,i,j,p=0;
	scanf("%d %d %d",&a,&b,&c);
	for(i=1;i<b;i++){
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			p+=31;
		}else if(i==4||i==6||i==9||i==11){
			p+=30;
		}else if(i==2){
			if(a%400==0||(a%4==0&&a%100!=0)){
				p+=29;
			}else{
				p+=28;
			}
		}
	}
	if(a>2000){
		a%=2000;
	}
	for(j=1;j<a;j++){
		if(j%400==0||(j%4==0&&j%100!=0)){
			p+=2;
		}else{
			p+=1;
		}
	}
	p+=c;
	if(p%7==1){
		printf("Mon.");
	}else if(p%7==2){
		printf("Tue.");
	}else if(p%7==3){
		printf("Wed.");
	}else if(p%7==4){
		printf("Thu.");
	}else if(p%7==5){
		printf("Fri.");
	}else if(p%7==6){
		printf("Sat.");
	}else{
		printf("Sun.");
	}
	return 0;
}