#include <iostream>
#include <map>
using namespace std;map<string,int> ch;
map<int,string> x;
int M[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
bool isrun(int y){
    if(y%400==0||(y%4==0&&y%100!=0)) return true;
    return false;
}
void add(int& y,int& m,int& d){
    if(isrun(y)) M[2]=29;else M[2]=28;
    d++;if(d>M[m]) {d=1;m++;if(m>12){m=1;y++;}}
    
}

int main() {
    x[0]="Sunday";x[1]="Monday";x[2]="Tuesday";x[3]="Wednesday";
     x[4]="Thursday";x[5]="Friday";x[6]="Saturday";
    ch["October"]=10;ch["December"]=12;ch["November"]=11;
ch["September"]=9;ch["August"]=8;
ch["July"]=7;ch["June"]=6;
ch["May"]=5;ch["April"]=4;
ch["March"]=3;ch["February"]=2;
ch["January"]=1;
    string a1,a2,a3;
  while( cin >> a3>>a2>>a1 ){int ans=0;
        int y1=stoi(a1);
        int m1=ch[a2]; int d1=stoi(a3);
          int y2=2024;
        int m2=5; int d2=17;
        string x2="20240517";
        string x1="";x1+=to_string(y1);if(m1<10)x1+="0";x1+=to_string(m1);
        if(d1<10) x1+="0";x1+=to_string(d1);
        int f=0;
        if(x1>x2) {f=1;swap(y1,y2);swap(d1,d2);swap(m1,m2);}
        while(y1!=y2||m1!=m2||d1!=d2){
            add(y1,m1,d1);ans++;
        }
        if(f){ans%=7; ans=(5+ans)%7;}//比今天大
        else{ans%=7; ans=(5-ans+7)%7;}
        cout<<x[ans]<<endl;}
    
}