#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
	const string day[]={"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
	const int month[]={31,29,31,30,31,30,31,31,30,31,30,31};
	int m,d,res=3;
	while(cin>>m>>d,m||d){
		for(int i=1;i<m;++i)
			res+=month[i-1];
		res+=d-1;
		cout<<day[res%7]<<endl;
	}
	return 0;
}