#include <stdio.h>

int main(void){
    int m,d,ds=0,i;
    while(scanf("%d %d",&m,&d)!=EOF){
        if(m==0) break;
        for(i=1;i<m;i++){
            if(i==2){
                ds+=29;
            }
            else if(i==4||i==6||i==9||i==11){
                ds+=30;
            }
            else{
                ds+=31;
            }
        }
        ds+=d-1;
        if(ds%7==5){
            printf("Monday\n");
        }
        else if(ds%7==6){
            printf("Tuesday\n");
        }
        else if(ds%7==0){
            printf("Wednesday\n");
        }
        else if(ds%7==1){
            printf("Thursday\n");
        }
        else if(ds%7==2){
            printf("Friday\n");
        }
        else if(ds%7==3){
            printf("Saturday\n");
        }
        else if(ds%7==4){
            printf("Sunday\n");
        }
    }
    return 0;
}