#include <iostream>

using namespace std;

int main(){
	int i;
	int a, b;
	int day=0;
	int t;

	cin >> a;

	while(a != 0){
		if(a=1){
			day = day;
		}
		if(a=2){
			day = day + 31;
		}
		if(a=3){
			day = day + 60;
		}
		if(a=4){
			day = day + 91;
		}
		if(a=5){
			day = day + 121;
		}
		if(a=6){
			day = day + 152;
		}
		if(a=7){
			day = day + 182;
		}
		if(a=8){
			day = day + 213;
		}
		if(a=9){
			day = day + 244;
		}
		if(a=10){
			day = day + 274;
		}
		if(a=11){
			day = day + 305;
		}
		if(a=12){
			day = day + 335;
		}

		cin >> b;
		day = day + b;

		t = day % 7;
		if(t=1){
			cout << "Wednesday" << endl;
		}
		if(t=2){
			cout << "Thersday" << endl;
		}
		if(t=3){
			cout << "Friday" << endl;
		}
		if(t=4){
			cout << "Saturday" << endl;
		}
		if(t=5){
			cout << "Sunday" << endl;
		}
		if(t=6){
			cout << "Monday" << endl;
		}
		else{
			cout << "Tuesday" << endl;
		}
	}


}