#include <cstdio>
#include <iostream>
#include <string>
#include <map>
using namespace std;
//谢谢博友好程序 泽勒公式 背
int main()
{
map<int,string> mp;
mp[0]="sunday";
mp[1]="monday";
mp[2]="tuesday";
mp[3]="wednesday";
mp[4]="thursday";
mp[5]="friday";
mp[6]="saturday";
while(1)
{
int w,c,y,m,d;
cin>>y>>m>>d;
//cout<<y<<" "<<m<<" "<<d<<endl;
if(cin.eof()==1)
{
//cout<<"eof"<<endl;
break;
}
if(m<3)//不能删除 记忆
{
y--;
m+=12;
}
c=y/100;
y=y%100;
w=y+y/4+c/4-2*c+(26*(m+1))/10+d-1;
//cout<<w<<endl;
//cout<<w%7<<endl;
cout<<mp[(w%7+7)%7]<<endl;//抄博友程序
}
return 0;
}