Start: Jun, 26, 2019 08:30:00
2019年度暑期短学期第一天
End: Jun, 26, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 5ms
Memory: 1092kB
Author: 2018212212165
In contest: 1273

#include<stdio.h>
#include<math.h>
int main(){
	int a,b,c,w;
	while(scanf("%d%d%d",&a,&b,&c)!=EOF){
		if(b==1){
			a=a-1;b=13;
			w=(c+2*b+3*(b+1)/5+a+a/4-a/100+a/400)%7;
			if(w==0)printf("Monday\n");
			if(w==1)printf("Tuesday\n");
			if(w==2)printf("Wednesday\n");
			if(w==3)printf("Thursday\n");
			if(w==4)printf("Friday\n");
			if(w==5)printf("Saturday\n");
			if(w==6)printf("Sunday\n");
		}
		else if(b==2){
			a=a-1;b=14;
			w=(c+2*b+3*(b+1)/5+a+a/4-a/100+a/400)%7;
		    if(w==0)printf("Monday\n");
			if(w==1)printf("Tuesday\n");
			if(w==2)printf("Wednesday\n");
			if(w==3)printf("Thursday\n");
			if(w==4)printf("Friday\n");
			if(w==5)printf("Saturday\n");
			if(w==6)printf("Sunday\n");
		}
		else {
			w=(c+2*b+3*(b+1)/5+a+a/4-a/100+a/400)%7;
			if(w==0)printf("Monday\n");
			if(w==1)printf("Tuesday\n");
			if(w==2)printf("Wednesday\n");
			if(w==3)printf("Thursday\n");
			if(w==4)printf("Friday\n");
			if(w==5)printf("Saturday\n");
			if(w==6)printf("Sunday\n");
		}
	}
	return 0;
}