#include<iostream>
#include<map>
using namespace std;
int day[]={31,29,31,30,31,30,31,31,30,31,30,31};
int main(){
	int m,d;
	map<int,string>v;
	v[0]="Wednesday";
	v[1]="Thursday";
	v[2]="Friday";
	v[3]="Saturday";
	v[4]="Sunday";
	v[5]="Monday";
	v[6]="Tuesday";
	while(cin>>m>>d){
		if(m==0&&d==0)
			break;
		int temp=d;
		for(int i=1;i<m;i++)
			temp+=day[i-1];
		temp%=7;
		cout<<v[temp]<<endl;
	}
	return 0;
}
