#include<cstdio>
#include<iostream>
using namespace std;
main(){
  int m,d;
  while(1){
    cin >> m >> d;
    if(m==0){
      exit(0);
    }
    if(m>2){
      d=d-2;
      if(m>4){
	d--;
	if(m>6){
	  d--;
	  if(m>9){
	    d--;
	    if(m>11){
	      d--;
	    }
	  }
	}
      }
    }
    m--;
    d=(d+m*31)%7;
    if(d==0){
      cout <<"Wednesday"<< endl;
    }
    else if(d==1){
      cout <<"Thursday"<< endl;
    }
    else if(d==2){
      cout <<"Friday"<< endl;
    }
    else if(d==3){
      cout <<"Saturday"<< endl;
    }
    else if(d==4){
      cout <<"Sunday"<< endl;
    }
    else if(d==5){
      cout <<"Monday"<< endl;
    }
    else if(d==6){
      cout <<"Tuesday"<< endl;
    }
  }
}