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

#define YEAR 2004

using namespace std;

int main() {
	vector<string> week;
	week.push_back("Monday");
	week.push_back("Tuesday");
	week.push_back("Wednesday");
	week.push_back("Thursday");
	week.push_back("Friday");
	week.push_back("Saturday");
	week.push_back("Sunday");
	int month[12] = {31,29,31,30,31,30,31,31,30,31,30,31};

	int m,d;
	int index = 3; //1月1日が木曜日なので

	while(cin>>m>>d){
		if(m==0 || d==0){ break; }
		for(int i=0; i<m; i++){
			for(int j=1; j<=month[i]; j++){
				if(i+1==m and j==d){ break; }
				index++;
				if(index == 7) index=0;
			}
		}
		cout<<week[index]<<endl;
		index = 3;
	}
	return 0;
}