#include <iostream>
using namespace std;
#define reep(i,f,n) for(int i=f;i<(int)n;++i)
#define rep(i,n) reep(i,0,n)
int d[13][32];
int main()
{
    d[1][1]=4;
    reep(i,2,32){
        if(d[1][i-1]!=7)d[1][i]=d[1][i-1]+1;
        else d[1][i]=1;
    }
    d[2][1]=d[1][31]+1;
    reep(i,2,30){
        if(d[2][i-1]!=7)d[2][i]=d[2][i-1]+1;
        else d[2][i]=1;
    }
    d[3][1]=d[2][29]+1;
    reep(i,2,32){
        if(d[3][i-1]!=7)d[3][i]=d[3][i-1]+1;
        else d[3][i]=1;
    }
    d[4][1]=d[3][31]+1;
    reep(i,2,31){
        if(d[4][i-1]!=7)d[4][i]=d[4][i-1]+1;
        else d[4][i]=1;
    }
    d[5][1]=d[4][30]+1;
    reep(i,2,32){
        if(d[5][i-1]!=7)d[5][i]=d[5][i-1]+1;
        else d[5][i]=1;
    }
    d[6][1]=d[5][31]+1;
    reep(i,2,31){
        if(d[6][i-1]!=7)d[6][i]=d[6][i-1]+1;
        else d[6][i]=1;
    }
    d[7][1]=d[6][30]+1;
    reep(i,2,32){
        if(d[7][i-1]!=7)d[7][i]=d[7][i-1]+1;
        else d[7][i]=1;
    }
    d[8][1]=d[7][31]+1;
    reep(i,2,32){
        if(d[8][i-1]!=7)d[8][i]=d[8][i-1]+1;
        else d[8][i]=1;
    }
    d[9][1]=d[8][31]+1;
    reep(i,2,31){
        if(d[9][i-1]!=7)d[9][i]=d[9][i-1]+1;
        else d[9][i]=1;
    }
    d[10][1]=d[9][30]+1;
    reep(i,2,32){
        if(d[10][i-1]!=7)d[10][i]=d[10][i-1]+1;
        else d[10][i]=1;
    }
    d[11][1]=d[10][31]+1;
    reep(i,2,30){
        if(d[11][i-1]!=7)d[11][i]=d[11][i-1]+1;
        else d[11][i]=1;
    }
    d[12][1]=d[11][30]+1;
    reep(i,2,32){
        if(d[12][i-1]!=7)d[12][i]=d[12][i-1]+1;
        else d[12][i]=1;
    }
    while(1)
    {
        int m,day;
        cin>>m>>day;if(!m)return 0;
        const char* str[10]={0,"Monday", "Tuesday", "Wednesday","Thursday", "Friday", "Saturday", "Sunday"};
        cout<<str[d[m][day]]<<endl;
    }
    return 0;
}