#include<iostream>
using namespace std;
int main (){
	int a,b=0,c,tuki,hi;
	for(;;){
	cin>>tuki>>hi;
	if(tuki==0&&hi==0){
		break;
	}
	for(a=1;a<=hi;a++){
		b++;
	}
	if(tuki==1){
		b=b+31;
	}else if(tuki==2){
		b=b+31+29;
	}else if(tuki==3){
		b=b+31+29+31;
	}else if(tuki==4){
		b=b+31+29+31+30;
	}else if(tuki==5){
		b=b+31+29+31+30+31;
	}else if(tuki==6){
		b=b+31+29+31+30+31+30;
	}else if(tuki==7){
		b=b+31+29+31+30+31+30+31;
	}else if(tuki==8){
		b=b+31+29+31+30+31+30+31+31;
	}else if(tuki==9){
		b=b+31+29+31+30+31+30+31+31+30;
	}else if(tuki==10){
		b=b+31+29+31+30+31+30+31+31+30+31;
	}else if(tuki==11){
		b=b+31+29+31+30+31+30+31+31+30+31+30;
	}else if(tuki==12){
		b=b+31+29+31+30+31+30+31+31+30+31+30+31;
	}
	c=b%7;
	if(c==0){
		cout<<"Monday";
	}else if(c==1){
		cout<<"Tuesday";
	}else if(c==2){
		cout<<"Wednesday";
	}else if(c==3){
		cout<<"Thursday";
	}else if(c==4){
		cout<<"Friday";
	}else if(c==5){
		cout<<"Saturday";
	}else if(c==6){
		cout<<"Sunday";
	}
	cout<<endl;
	}
}
	