#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    int m,d;
    while(cin>>m>>d){
        if(m==0&&d==0){
            break;
        }
        if(m==1||m==4||m==7){
            if(d%7==1){
                cout<<"Thursday"<<endl;
            }else if(d%7==2){
                cout<<"Friday"<<endl;
            }else if(d%7==3){
                cout<<"Saturday"<<endl;
            }else if(d%7==4){
                cout<<"Sunday"<<endl;
            }else if(d%7==5){
                cout<<"Monday"<<endl;
            }else if(d%7==6){
                cout<<"Tuesday"<<endl;
            }else if(d%7==0){
                cout<<"Wednesday"<<endl;
            }
        }
        if(m==2||m==8){
            if(d%7==5){
                cout<<"Thursday"<<endl;
            }else if(d%7==6){
                cout<<"Friday"<<endl;
            }else if(d%7==0){
                cout<<"Saturday"<<endl;
            }else if(d%7==1){
                cout<<"Sunday"<<endl;
            }else if(d%7==2){
                cout<<"Monday"<<endl;
            }else if(d%7==3){
                cout<<"Tuesday"<<endl;
            }else if(d%7==4){
                cout<<"Wednesday"<<endl;
            }
        }
        if(m==3){
            if(d%7==4){
                cout<<"Thursday"<<endl;
            }else if(d%7==5){
                cout<<"Friday"<<endl;
            }else if(d%7==6){
                cout<<"Saturday"<<endl;
            }else if(d%7==0){
                cout<<"Sunday"<<endl;
            }else if(d%7==1){
                cout<<"Monday"<<endl;
            }else if(d%7==2){
                cout<<"Tuesday"<<endl;
            }else if(d%7==3){
                cout<<"Wednesday"<<endl;
            }
        }
        if(m==5){
            if(d%7==6){
                cout<<"Thursday"<<endl;
            }else if(d%7==0){
                cout<<"Friday"<<endl;
            }else if(d%7==1){
                cout<<"Saturday"<<endl;
            }else if(d%7==2){
                cout<<"Sunday"<<endl;
            }else if(d%7==3){
                cout<<"Monday"<<endl;
            }else if(d%7==4){
                cout<<"Tuesday"<<endl;
            }else if(d%7==5){
                cout<<"Wednesday"<<endl;
            }
        }
        if(m==6){
            if(d%7==3){
                cout<<"Thursday"<<endl;
            }else if(d%7==4){
                cout<<"Friday"<<endl;
            }else if(d%7==5){
                cout<<"Saturday"<<endl;
            }else if(d%7==6){
                cout<<"Sunday"<<endl;
            }else if(d%7==0){
                cout<<"Monday"<<endl;
            }else if(d%7==1){
                cout<<"Tuesday"<<endl;
            }else if(d%7==2){
                cout<<"Wednesday"<<endl;
            }
        }
        if(m==9||m==12){
            if(d%7==2){
                cout<<"Thursday"<<endl;
            }else if(d%7==3){
                cout<<"Friday"<<endl;
            }else if(d%7==4){
                cout<<"Saturday"<<endl;
            }else if(d%7==5){
                cout<<"Sunday"<<endl;
            }else if(d%7==6){
                cout<<"Monday"<<endl;
            }else if(d%7==0){
                cout<<"Tuesday"<<endl;
            }else if(d%7==1){
                cout<<"Wednesday"<<endl;
            }
        }
        if(m==10){
            if(d%7==0){
                cout<<"Thursday"<<endl;
            }else if(d%7==1){
                cout<<"Friday"<<endl;
            }else if(d%7==2){
                cout<<"Saturday"<<endl;
            }else if(d%7==3){
                cout<<"Sunday"<<endl;
            }else if(d%7==4){
                cout<<"Monday"<<endl;
            }else if(d%7==5){
                cout<<"Tuesday"<<endl;
            }else if(d%7==6){
                cout<<"Wednesday"<<endl;
            }
        }
        if(m==11){
            if(d%7==4){
                cout<<"Thursday"<<endl;
            }else if(d%7==5){
                cout<<"Friday"<<endl;
            }else if(d%7==6){
                cout<<"Saturday"<<endl;
            }else if(d%7==0){
                cout<<"Sunday"<<endl;
            }else if(d%7==1){
                cout<<"Monday"<<endl;
            }else if(d%7==2){
                cout<<"Tuesday"<<endl;
            }else if(d%7==3){
                cout<<"Wednesday"<<endl;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3048