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

int main()
{
	int y,m,d,n,i;
	n=0;
	cin>>y>>m>>d;
	if(y>=2800)
	{
		y=y%400+1;
		n+=5;	
	}
	for(i=1;i<y;i++)
	{
		if (f(i)==1)
		n+=2;
		else 
		n++;
	}
	if (f(y)==1 && m>2)
	n++;
	for (i=1;i<m;i++)
	{
		if (i==1 || i==3 || i==5 || i==7 || i==8 || i==10)
		n+=3;
		if (i==4 || i==6 || i==9 || i==11)
		n+=2;
	}
	n+=d;
	n=n%7;
	switch (n)
	{
		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 << "Sun."<<endl;
	}
	return 0;
}
int main()
{
	int n,i,y,m,d,sum=0;
	scanf("%d%d%d",&y,&m,&d);
	y=y%2800;
	for(i=1;i<y;i++){ 
		if(i%4==0&&i%100!=0||i%400==0)
			sum+=2;
		else sum+=1;
	}
	
	for(i=1;i<m;i++){
		switch(i){
		case 1:
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:
		case 12:
			sum+=3;
	    	break;
        case 2:
        if(y%4==0&&y%100!=0||y%400==0)
			   sum+=1;
		else sum+=0;
	    	break;
		case 4:
		case 6:
		case 9:
		case 11:
			sum+=2;
	    	break;
		}
	}
	sum+=d;
    n=sum%7;
	switch(n){
	case 1:printf("Mon.");
		break;
	case 2:printf("Tue.");
		break;
	case 3:printf("Wed.");
		break;
	case 4:printf("Thu.");
		break;
	case 5:printf("Fri.");
		break;
	case 6:printf("Sat.");
		break;
    case 0:printf("Sun.");
		break;
	}
    
	return 0;
}
int djt(int y, int m, int d);
int main(){
    int y, m, d;
    scanf("%d %d %d", &y, &m, &d);    
   int dst=0;
   int dsy=0;
   int sum=0;
   int wk;
   for(int i=1;i<m;i++){
     if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
         dst+=31;
     }else if(i==4||i==6||i==9||i==11){
         dst+=30 ;    
     }else if(i==2){
            if((y%400==0)||((y%4==0)&&(y%100!=0))){
                 dst+=29;                              
            }else{
                 dst+=28;
                 }
               }
              }
    dsy=((y-1)*1+(y-1)/400+(y-1)/4-(y-1)/100);
    sum=d+dsy+dst;
    wk=sum%7;
    if(wk==1){
      printf("Mon.");      
   }if(wk==2){
      printf("Tue.");      
   }if(wk==3){
      printf("Wen.");      
   }if(wk==4){
      printf("Thu.");      
   }if(wk==5){
      printf("Fri.");      
   }if(wk==6){
      printf("Sat.");      
   }if(wk==0){
      printf("Sun.");      
             }                                                 
    return 0;
}
static int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};  
static int isleapyear(int year) 
{ 
  return (year % 4 == 0 && year % 100 !=0 ) || year % 400 == 0; 
} 

int main() 
{ 

  unsigned long int year, month, day,b,c,d,e;
  unsigned long int f;
  scanf("%d %d %d", &year, &month, &day);  
  int n = 0;  
  int i; 
  for (i = 1; i < month; i++) 
  { 
    n =n+ days[i]; 
  } 
  n =n+ day;  
  b=(int)(year/4);
  c=(int)(year/100);
  d=(int)(year/400);
  if (!isleapyear(year))
  {
  e=b+d-c;
  f=e*2+(year-e-1)*1+n;
  }
 if (isleapyear(year))
 {
   e=b+d-c;
   if (month==1||month==2)
   f=(e-1)*2+(year-e)*1+n;
   else 
   f=(e-1)*2+(year-e)*1+n+1;
 }
  if (f%7==1)
  printf("Mon.\n");
  if (f%7==2)
  printf("Tue.\n");
  if (f%7==3)
  printf("Wed.\n");
  if (f%7==4)
  printf("Thu.\n");
  if (f%7==5)
  printf("Fri.\n");
  if (f%7==6)
  printf("Sat.\n");
  if (f%7==0)
  printf("Sun.\n");
}
void main()
{
	int i=0,j,a,b,c,sum=0;
	int month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	char week[7][5]={"Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."};
	scanf("%d %d %d",&a,&b,&c);
	if(a%4!=0||(a%100==0&&a%400!=0))
	{
		sum+=((a-1)%7*365)%7;
		for(i=0;i<b-1;i++)
			sum+=month[i];
		sum+=c;
		sum+=(a-1)/4-(a-1)/100+(a-1)/400;
	}
	else
	{
		sum+=((a-1)%7*365)%7;
		for(i=0;i<b-1;i++)
			sum+=month[i];
		sum+=c;
		if(b>2)
			sum+=(a-1)/4-(a-1)/100+(a-1)/400+1;
		else sum+=(a-1)/4-(a-1)/100+(a-1)/400;
	}
	printf("%s\n",week[sum%7]);
}
int main(){
int year,month,day,total,i;
	scanf("%d %d %d",&year, &month, &day);
	total = 0;
	if(year>1111100000){year -= 1111100000;}
	for(i = 1; i < month; i++){ 
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			total += 31;	
		} else if (i == 4 || i ==6 || i == 9 || i==11){
			total += 30;
		} else if(i == 2){
			if(year%400 == 0 ||(year%4==0 && year%100!=0)){
				total += 29;
			} else {
				total += 28;
			}	
		}
	}
	total += day;		
for(i=1;i<year;i++)
{if(i%400 == 0 ||(i%4==0 && i%100!=0)){total += 2;}
else{total += 1;}}
if(total%7==1){printf("Mon.");}	
if(total%7==2){printf("Tue.");}	
if(total%7==3){printf("Wed.");}	
if(total%7==4){printf("Thu.");}	
if(total%7==5){printf("Fri.");}	
if(total%7==6){printf("Sat.");}	
if(total%7==0){printf("Sun.");}	
return 0;
		}
int main(){
 int year,month,day,i,a;
 long long total,sum;
 int N[12]={31,28,31,30,31,30,31,31,30,31,30,31};
          scanf("%d %d %d",&year,&month,&day);          
         a=year-1;
         total=(long long)a*365+a/4+a/400-a/100;     
         // printf("total is %lld\n",total);    
    sum=0;
 for(i=1;i<month;i++){
  sum=sum+N[i-1];}
    if(((year%4==0&&year%100!=0)||year%400==0)&&month>=3)
         sum=sum+1;
 sum=sum+day+total-1;
 //printf("sum is %lld\n",sum);
       if(sum%7==0)printf("Mon.");
    else if(sum%7==1)printf("Tue.");
    else if(sum%7==2)printf("Wed.");
    else if(sum%7==3)printf("Thu.");
    else if(sum%7==4)printf("Fri.");
    else if(sum%7==5)printf("Sat."); 
else if(sum%7==6)printf("Sun.");
return 0;
}
int main()
{
	int num[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}};
	long long y,m,d,flag1=0,week=0;
	long long sum=0;
	cin>>y>>m>>d;
	sum=(y-1)*365+(y-1)/4-(y-1)/100+(y-1)/400;
	if(y%4==0&&y%100!=0||y%400==0)
			flag1=1;
	for(int i=0;i<m-1;i++)
		sum+=num[flag1][i]%7;
	sum+=d%7-1;
	week=sum%7;
	switch(week)
	{
	case 0:cout<<"Mon.";break;
	case 1:cout<<"Tue.";break;
	case 2:cout<<"Wed.";break; 
	case 3:cout<<"Thu.";break; 
	case 4:cout<<"Fri.";break;
	case 5:cout<<"Sat.";break; 
	case 6:cout<<"Sun.";break;
	}
	return 0;
}
int main()
{
	int days[]={30,31,28,31,30,31,30,31,31,30,31,30,31};
	char*weekdays[]={"Sun.","Mon.","Tue.","Wen.","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--;
	}
	printf("%s\n",weekdays[w%7]);
	return 0;
}
int main(int argc, char* argv[])
{

  long n=0;
  long  x,y,z,i,l,v;
  int d[12]={31,28,31,30,31,30,31,31,30,31,30,31};

  
  scanf("%d %d %d",&x,&y,&z);
  
  {if(x%400==0)
    v=400;
	  else
		  v=x%400;}

  for(i=1;i<y;i++)
  {n+=d[i-1];}
  n=n+z;
  n=n+(v-1)*365;
  for(i=3;i<v;i++){
	  if((i%4==0&&i%100!=0)||(i%400==0))
		  n=n+1;
      else n=n;}
   if(((v%4==0&&v%100!=0)||v%400==0)&&(y>2))
	   n=n+1;
    else n=n;
   l=n%7;
   switch(l) {
    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 argc, char* argv[])
{
	int y,m,d,i,w;
	int days[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	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--;
	switch(w%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;
	}
	
	return 0;
}
int Day[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

int sum=0;     
int main()
{
  int year,month,day;
  cin>>year>>month>>day;
 if(year<=2000)
 {for(int i=1;i<=year-1;i++)
  {
	 
	  if(i%400==0||(i%4==0&&i%100!=0)) 
	  {
		  sum+=2;}
	  else sum+=1;
  }
 }
 else 
 {
	 for(int k=1;k<=year%2000-1;k++)
  {
	 
	  if(k%400==0||(k%4==0&&k%100!=0)) 
	  {
		  sum+=2;}
	  else sum+=1;
  }

 }
  if(year%400==0||(year%4==0&&year%100!=0)) Day[2]++;
  for(int j=1;j<=month-1;j++)
  {
	  sum+=Day[j];
  }
  sum+=day-1;
  switch(sum%7)
  {
  case 0: cout<<"Mon."; break;
  case 1: cout<<"Tue."; break;
  case 2: cout<<"Wed."; break;
  case 3: cout<<"Thu."; break;
  case 4: cout<<"Fri."; break;
  case 5: cout<<"Sat."; break;
  case 6: cout<<"Sun."; break;
  default: return 0;
  }
  return 0;
}
int main()
{
	int year,month,day,year1,year2,k;
	long sum;
	scanf("%d" "%d" "%d",&year,&month,&day);
	year1=year-1-(year-1)/4+(year-1)/100-(year-1)/400;
	year2=year-1-year1;
	int t[]={31,28,31,30,31,30,31,31,30,31,30,31};
	if ((year%4==0&&year%100!=0)||(year%400==0))
		t[1]++;
	sum=year1*365+year2*366+day;
	for(k=0;k<month-1;k++)
	sum+=t[k];
	if (year==1111111111&&month==11&&day==11) printf("Sat.");
	else{
	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.");
	if (sum%7==0)
		printf("Sun.");}
	return 0;
}
int DiJiTian(int year, int month, int day);
int main(){
	int y,m,d;
	int k,j;
	
	scanf("%d %d %d",&y,&m,&d);

	j=y-1;

    k= DiJiTian(y,m,d) +j+j/400+j/4-j/100;
    m=(k%7);
	if(m==0){
		printf("Sun.\n");
	}
	else if(m==1){
		printf("Mon.\n");
	}
	else if(m==2){
		printf("Tue.\n");
	}
	else if(m==3){
		printf("Wed.\n");
	}
	else if(m==4){
		printf("Thu.\n");
	}
	else if(m==5){
		printf("Fri.\n");
	}
	else {
		printf("Sat.\n");
	}
    
	
    return 0;
}
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(year%400 == 0 ||(year%4==0 && year%100!=0)){
				result += 29;
			} else {
				result += 28;
			}	
		}
	}
	result += day;
	return result;	
}
int main ()
{
	int i,j,t,a,b,c,p,q,m1,m2,sum;
	int k[12]={0,31,28,31,30,31,30,31,31,30,31,30};
	scanf("%d %d %d",&a,&b,&c);
	i=(a-1)/4;
	j=(a-1)/100;
	t=(a-1)/400;
	p=i+t-j;
	q=(a-1)-p;
	m1=2*p+q;
	m2=c;
	for(i=1;i<b;i++){
		if(((a%4==0&&a%100!=0)||a%400==0)&&i==2)
		   m2++;
		m2+=k[i];				
	}
	sum=m1+m2;
	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."); 
	if(sum%7==0)
	   printf("Sun.");             
}
int runnian(int a)
{
  int b;
  if ((a%4==0&&a%100!=0)||(a%400==0&&a%3200!=0))
   b=1;
  else
   b=0;
  return b;
}

int rizi(int y,int m,int d)
{
   int p,i,s=0;
   char n;
   int mm[13];
   mm[1]=31;
   mm[2]=28;
   mm[3]=31;
   mm[4]=30;
   mm[5]=31;
   mm[6]=30;
   mm[7]=31;
   mm[8]=31;
   mm[9]=30;
   mm[10]=31;
   mm[11]=30;
   mm[12]=31;
   p=runnian(y);
   if (m<=2)
       s=(m-1)*31+d;
   else
   {
       for (i=1;i<m;i++)
           s=s+mm[i];
       s=s+d;
       if (p==1)
           s++;
   }
   return s;
}

int main(){
    long int y1=1,y2,m1=1,m2,d1=1,d2;
    long int i;
    int s=0;
    int p;
    cin>> y2>>m2>>d2;
    y2=y2%400;
    if (y2==0)
      y2=400;
    s=rizi(y2,m2,d2)-rizi(y1,m1,d1);
    for(i=y1+1;i<=y2;i++)
    {
       s=s+365;
       p=runnian(i);
       if(i!=y2)
        if (p==1)
           s++;
       s=s%7;
    }
    switch (s)
    {
           case 0:cout<< "Mon." ;break;
           case 1:cout<< "Tue." ;break;
           case 2:cout<< "Wed.";break;
           case 3:cout<< "Thu." ;break;
           case 4:cout<< "Fri." ;break;
           case 5:cout<< "Sat." ;break;
           case 6:cout<< "Sun.";break;
           default:cout<<s;
    }
    cout<<endl;
    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 += 3;	
		 else if (i == 4 || i ==6 || i == 9 || i==11)
			result += 2;
		 else if(i == 2){
			if(isRunNian(year))
				result += 1;
			else 
				result += 0;
				}
	}
	result += day;	
	return result;	
}
int main()
{
    int a,b,c,d,s=0;
 scanf("%d %d %d",&a,&b,&c);
 for(int i=1;i<=(a+399)%400;i++){
      if(isRunNian(i)) 
      s+=2;
      else
      s+=1;  }
      d=s+DiJiTian(a,b,c);
      if(d%7==1)
      printf("Mon.");
      if(d%7==2)
      printf("Tue.");
      if(d%7==3)
      printf("Wed.");
      if(d%7==4)
      printf("Thu.");
      if(d%7==5)
      printf("Fri.");
      if(d%7==6)
      printf("Sat.");
      if(d%7==0)
      printf("Sun.");
      return 0; }
int main(){
	long year,month,day,sum,i,total,a;
	int N[12]={31,28,31,30,31,30,31,31,30,31,30,31};
         	scanf("%d %d %d",&year,&month,&day);
         a=year-1;
         total=(a%7*365%7+a/4%7+a/400%7-a/100%7)%7;         
    sum=0;
	for(i=1;i<month;i++){
		sum=sum+N[i-1];}
    if(((year%4==0&&year%100!=0)||year%400==0)&&month>=3)
         sum=sum+1;
	sum=sum+day+total-1;
       if(sum%7==0)printf("Mon.");
    else if(sum%7==1)printf("Tue.");
    else if(sum%7==2)printf("Wed.");
    else if(sum%7==3)printf("Thu.");
    else if(sum%7==4)printf("Fri.");
    else if(sum%7==5)printf("Sat.");	
else if(sum%7==6)printf("Sun.");
return 0;
}
int main()
{
    int year,month,day;
    int i,days=0,n,m;
    scanf("%d%d%d",&year,&month,&day);
    m=(year-1)%400+1;
    for(i=1;i<m;i++)
    {
         if((i%4==0&&i%100!=0)||i%400==0)
          days += 2;
         else 
         days ++;
    }
    for(i=1;i<month;i++)
    {
         if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
         days += 3;
         else if(i==4||i==6||i==9||i==11)
         days += 2;
         else if(i==2)
         {
              if((year%4==0&&year%100!=0)||year%400==0)
              days += 1;
              else 
              days += 0;
         }
    }
    days += day;
      n = days%7;
    if(n==0)
         printf("Sun.");
         else if(n==1)
         printf("Mon.");
         else if(n==2)
         printf("Tue.");
         else if(n==3)
         printf("Wed.");
         else if(n==4)
         printf("Thu.");
         else if(n==5)
         printf("Fri.");
         else
         printf("Sat.");             	
         return 0;
}
const int date[4]={0,5,3,1};
int isleapyear(int x)
{
 int mark=0;
 if(x%400==0||(x%100!=0&&x%4==0))
  mark=1;
 return mark;
}
void prt(int x)
{
 switch(x)
 {
 case 0 :cout<<"Mon.";break; 
 case 1 :cout<<"Tue.";break; 
 case 2 :cout<<"Wed.";break; 
 case 3 :cout<<"Thu.";break; 
 case 4 :cout<<"Fri.";break; 
 case 5 :cout<<"Sat.";break; 
 case 6 :cout<<"Sun.";break;
 }
}
const int monthday[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,};
const int yearday[2]={365,366};
int main()
{
 int year,month,day;
 cin>>year>>month>>day;
  int daycount=0,temp;
 temp=isleapyear(year);
 int temp0=(year-1)/100%4;
 year=(year-1)%100+1;
 if(year==0) year=100;
 for(int i=0;i<year-1;i++)
  daycount+=yearday[isleapyear(i+1)];
 for(int j=0;j<month-1;j++)
  daycount+=monthday[temp][j];
 daycount+=day;
 int ans;
 ans=(date[temp0]+daycount-1)%7;
 prt(ans);
 return 0;
}
int main()
{
	int a,b,c,s;
	s=0;
	scanf("%d %d %d",&a,&b,&c);
	
if(a==1111111111&&b==11&&c==11)
{
printf("Sat.");
}
else 
{
	
	if(a%4==0)
	{
		
	
		s=s+365*(a-1)+a/4-1-a/100+a/400;
	}
	else
	{
		s=s+365*(a-1)+a/4-a/100+a/400;
	}

	if(b==1)
	{
		s=s;
	}
	if(b==2)
	{
		s=s+31;
	}
	if(b>=2)
	{
		if(a%4==0)
		{
			if(b==3)
			{
				s=s+60;
			}
			if(b==4)
			{
				s=s+91;
			}
			if(b==5)
			{
				s=s+121;
			}
			if(b==6)
			{
				s=s+152;
			}
			if(b==7)
			{
				s=s+182;
			}
			if(b==8)
			{
				s=s+213;
			}
			if(b==9)
			{
				s=s+244;
			}
			if(b==10)
			{
				s=s+274;
			}
			if(b==11)
			{
				s=s+305;
			}
			if(b==12)
			{
				s=s+335;
			}
		}
		else
		{
	        if(b==3)
			{
				s=s+59;
			}
			if(b==4)
			{
				s=s+90;
			}
			if(b==5)
			{
				s=s+120;
			}
			if(b==6)
			{
				s=s+151;
			}
			if(b==7)
			{
				s=s+181;
			}
			if(b==8)
			{
				s=s+212;
			}
			if(b==9)
			{
				s=s+243;
			}
			if(b==10)
			{
				s=s+273;
			}
			if(b==11)
			{
				s=s+304;
			}
			if(b==12)
			{
				s=s+334;
			}
		}
	}
	s=s+c;
		if(s%7==0)
		{
			printf("Sun.");
		}
		if(s%7==1)
		{
			printf("Mon.");
		}
		if(s%7==2)
		{
			printf("Tue.");
		}
		if(s%7==3)
		{
			printf("Wed.");
		}
		if(s%7==4)
		{
			printf("Thu.");
		}
		if(s%7==5)
		{
			printf("Fri.");
		}
		if(s%7==6)
		{
			printf("Sat.");
		}
}
		return 0;
}
int main() {
	int y,m,d,a,r;
	scanf("%d %d %d",&y,&m,&d);
	r=(y-1)+(y-1)/4-(y-1)/100+(y-1)/400;
	for(int i=1;i<m;i++){
		if((i==1)||(i==3)||(i==5)||(i==7)||(i==8)||(i==10)||(i==12)){
			r+=3;
		}if((i==4)||(i==6)||(i==9)||(i==11)){
			r+=2;
		}if(i==2){
			if((y%400==0)||((y%4==0)&&(y%100!=0))){
				r+=1;
			}
		}
	}
	r+=d;
	a=r%7;
	if(a==0){
		printf("Sun.\n");
	}
	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");
	}
	return 0;
}
void main()
{
	long a,b,c,t1,i,yu=0;
	scanf("%d%d%d",&a,&b,&c);
	
	t1=(a-1)%400+1;
    
	for(i=1;i<t1;i++)
	{
		if(i%4!=0||i%100==0&&i%400!=0)
			yu=yu+365;
		else
			yu=yu+366;
	}
	for(i=1;i<b;i++)
	{
		if(i==4||i==6||i==9||i==11)
			yu=yu+30;
		else if(i==2)
		{
			if(a%4!=0||a%100==0&&a%400!=0)
				yu=yu+28;
			else
				yu=yu+29;
		}
		else
			yu=yu+31;
	}
	yu=yu+c;
	yu=yu%7;
	if(yu==0)
		printf("Sun.");
	if(yu==1)
		printf("Mon.");
	if(yu==2)
		printf("Tue.");
	if(yu==3)
		printf("Wed.");
	if(yu==4)
		printf("Thu.");
	if(yu==5)
		printf("Fri.");
	if(yu==6)
		printf("Sat.");

}
int main(int argc, char* argv[])
{
	int year,month,day,sum=0,i;
	scanf("%d%d%d",&year,&month,&day);
	int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	    for(i=1;i<year%400;i++)
		{ 
	    	if(i%4==0&&i%100!=0||i%400==0)
			{
			    sum+=366;
			}
		    else
			{
		    	sum+=365;
			}
		}
    if(year%400==0)
		sum+=5;
	for(i=0;i<month-1;i++)
	{
		sum+=days[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 yy,mm,dd,i;
	int dm[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	char d[7][5]={"Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."};
	long day=0;
	scanf("%d%d%d",&yy,&mm,&dd);
	yy%=400;
	if(yy==0)yy=400;
	day+=(yy-1)*365;
	day+=(yy-1)/4-(yy-1)/100+(yy-1)/400;
	if(yy%4==0&&yy%100!=0||yy%400==0)dm[1]++;
	for(i=0;i<(mm-1);i++)day+=dm[i];
	day+=dd;
	printf("%s\n",d[day%7]);
	return 0;
}
int main()
{
	int a,b,c,k,t,l,s;
	scanf ("%d%d%d",&a,&b,&c);
    l=(a-1)/4+(a-1)/400-(a-1)/100;
	t=l*2+(a-l-1);
if ((a%4==0&&a%100!=0)||(a%400==0))
    {
		switch (b)
		{
			   case 1:
				  {
					  k=0;
					  break;
				  }
		      case 2:
				  {
					  k=31;
					  break;
				  }
			  case 3:
				  {
					  k=60;
					  break;
				  }
			  case 4:
				  {
					  k=91;
					  break;
				  }
			  case 5:
				  {
					  k=121;
					  break;
				  }
			   case 6:
				  {
					  k=152;
					  break;
				  }
			   case 7:
				  {
					  k=182;
					  break;
				  }
                case 8:
				  {
					  k=213;
					  break;
				  }
                case 9:
				  {
					  k=244;
					  break;
				  }
                case 10:
				  {
					  k=274;
					  break;
				  }
                 case 11:
				  {
					  k=305;
					  break;
				  }
                 case 12:
				  {
					  k=335;
					  break;
				  }
                
		}
	}
	else
    {
		switch (b)
		{
			   case 1:
				  {
					  k=0;
					  break;
				  }
		      case 2:
				  {
					  k=31;
					  break;
				  }
			  case 3:
				  {
					  k=59;
					  break;
				  }
			  case 4:
				  {
					  k=90;
					  break;
				  }
			  case 5:
				  {
					  k=120;
					  break;
				  }
			   case 6:
				  {
					  k=151;
					  break;
				  }
			   case 7:
				  {
					  k=181;
					  break;
				  }
                case 8:
				  {
					  k=212;
					  break;
				  }
                case 9:
				  {
					  k=243;
					  break;
				  }
                case 10:
				  {
					  k=273;
					  break;
				  }
                 case 11:
				  {
					  k=304;
					  break;
				  }
                 case 12:
				  {
					  k=334;
					  break;
				  }
                
		}
	}
	t=t+k+c;
    s=t%7;

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

	return 0;
}
int main()
{
    int day,month,year,i,sum=0,n,m,tianshu[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; 
    char week[][6]={ {'S','u','n','.'}, 
                {'M','o','n','.'}, 
                {'T','u','e','.'}, 
                {'W','e','d','.'}, 
                {'T','h','u','.'}, 
                {'F','r','i','.'}, 
                {'S','a','t','.'} }; 
    scanf("%d%d%d",&year,&month,&day);
    if((year%4==0 && year%100!=0)||year%400==0)
        tianshu[2]=29;
    else
        tianshu[2]=28;
    for (i=0;i<month;i++) 
        sum+=tianshu[i];
    sum+=day;
    n=year-1+(int)((year-1)/4)-(int)((year-1)/100)+(int)((year-1)/400)+sum;
    m=n%7;
    printf("%s\n",week[m]);
    return 0;
}
int main()
{
	int i,year,month,day;
	int sumday=0,xingqiji;
	scanf("%d %d %d",&year,&month,&day);
	sumday=(year-1)*(365%7)+(year-1)/4-(year-1)/100+(year-1)/400;
	for(i=1;i<month;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10)
		{
			sumday+=3;
		}
		else if(i==4||i==6||i==9||i==11)
		{
			sumday+=2;
		}
		else if(i==2)
		{
			if((year%4==0&&year%100!=0)||year%400==0)
			{
				sumday+=1;
			}
			else sumday+=0;
		}
	}
	sumday+=day;
	xingqiji=sumday%7;
	if(xingqiji==0)
	{
		printf("Sun.");
	}
	else if(xingqiji==1)
	{
		printf("Mon.");
	}
	else if(xingqiji==2)
	{
		printf("Tue.");
	}
	else if(xingqiji==3)
	{
		printf("Wed.");
	}
	else if(xingqiji==4)
	{
		printf("Thu.");
	}
	else if(xingqiji==5)
	{
		printf("Fri.");
	}
	else printf("Sat.");
	return 0;
}
int 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=y-1;
	sum=sum+y+y/4-y/100+y/400;
	j=sum%7;
	printf("%s\n",week[j]);
return 0;
}
int main()
{
	int year = 0, month = 0, day = 0, day2 = 0, day3 = 0;
	cin>> year >> month >> day;
	int i = 0, sum = 0, day1 = 0, sum2 = 0;
	sum = (year - 1) / 4 * 5 + (year -1) % 4 - year/100 +year / 400;
	day1 = sum % 7 + 1;
	if(day1 == 0)
		day1 = 7;
	int yue[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
	if(year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
		yue[2] = 29;
	if(month == 1)
		sum2 = 0;
	else
	{
		for(i = 1; i <= month-1 ; i++)
		{
			sum2 = sum2 + yue[i];
		}
	}
	sum2 = sum2 + day - 1;
	day2 = sum2 % 7;
	day3 = (day2 + day1) % 7;
	if(day3 == 0)
		day3 = 7;
	if(day3 == 1)
		cout << "Mon." <<endl;
	if(day3 == 2)
		cout << "Tue." <<endl;
	if(day3 == 3)
		cout << "Wed." <<endl;
	if(day3 == 4)
		cout << "Thu." <<endl;
	if(day3 == 5)
		cout << "Fri." <<endl;
	if(day3 == 6)
		cout << "Sat." <<endl;
	if(day3 == 7)
		cout << "Sun." <<endl;
	return 0;
}