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