
//Nayeem Shahriar Joy ,Applied Physics And Electronic Engineering , University of Rajshahi.

 #include<iostream>
#include<string>
#include<algorithm>
#include<vector>

using namespace std;

int dayoftheweek(int d,int m,int y)

{
    int t[]={0,3,2,5,0,3,5,1,4,6,2,4};
    y=y-m<3;
    return (y+y/4-y/100+y/400+t[m-1]+d)%7;
}

int main(){

   int m,d;

   while(cin>>m>>d){

        if(m==0 && d==0)

        {
            break;
        }

   int w = dayoftheweek(d,m,2004);

   if(w==1)

   {
       cout<<"Thursday"<<endl;
   }

   else if(w==2)

   {
       cout<<"Friday"<<endl;
   }

   else if(w==3)

   {
       cout<<"Saturday"<<endl;
   }

   else if(w==4)

   {
       cout<<"Sunday"<<endl;
   }

   else if(w==5)

   {
       cout<<"Monday"<<endl;
   }

   else if(w==6)

   {
       cout<<"Tuesday"<<endl;
   }

   else if(w==7)

   {
       cout<<"Wednesday"<<endl;
   }
   }

    return 0;
}