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: 23ms
Memory: 1712kB
Author: 2018212212013
In contest: 1273

#include<iostream>
#include<cmath>
#include<string>
using namespace std;
int main(){
	int y,m,d,w;
	while(cin>>y>>m>>d){
		if(m==1||m==2) m+=12,y=y-1;
   	    w=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400+1)%7;
		if(w==1)	cout<<"Monday"<<endl;
		else if(w==2)	cout<<"Tuesday"<<endl;
		else if(w==3)  cout<<"Wednesday"<<endl;
		else if(w==4)  cout<<"Thursday"<<endl;
		else if(w==5)  cout<<"Friday"<<endl;
		else if(w==6)  cout<<"Saturday"<<endl;
		else if(w==0)  cout<<"Sunday"<<endl;
	}
	//system("pause");
	return 0;
}