#include<iostream>
using namespace std;
int main()
{
int y,m,d;
while (cin >> y >> m >> d)
{
int w,c;
if (m==1||m==2)
{
m+=12;
y--;
}
c=y/100;
y=y%100;
w=(y+y/4+c/4-2*c+26*(m+1)/10+d-1);
//cout << w;
w=(w%7+7)%7;
switch(w)
{
case(0):
cout << "Sunday"<<endl;
break;
case(1):
cout << "Monday" <<endl;
break;
case(2):
cout << "Tuesday" <<endl;
break;
case(3):
cout << "Wednesday" <<endl;
break;
case(4):
cout << "Thursday" <<endl;
break;
case(5):
cout << "Friday" <<endl;
break;
case(6):
cout << "Saturday" <<endl;
break;
}
}
}