#include<iostream>
#include<string>
using namespace std;
int main() {
	int a, b,h,  kazu;
	int  ans[1000];
	kazu = 0;
	while (1) {
		cin >> a >> b;
		if (a == 0) {
			goto a;
		}
		h = 0;
		kazu = kazu + 1;
		if (a >= 2) {
			h = 31;
		}
		if (a >= 3) {
			h = h + 29;
		}
		if (a >= 4) {
			h = h + 31;
		}
		if (a >= 5) {
			h = h + 30;
		}
		if (a >= 6) {
			h = h + 31;
		}
		if (a >= 7) {
			h = h + 30;
		}
		if (a >= 8) {
			h = h + 31;
		}
		if (a >= 9) {
			h = h + 31;
		}
		if (a >= 10) {
			h = h + 30;
		}
		if (a >= 11) {
			h = h + 31;
		}
		if (a >= 12) {
			h = h + 30;
		}
		h = h + b;
		while (h > 7) {
			h = h % 7;
		}
		ans[kazu] = h;
		
	}
a:;
	for (int x = 1; x <= kazu; x++) {
		if (ans[x] == 0) {
			cout << "Wednesday" << endl;
		}
			if (ans[x] == 1) {
				cout << "Thursday" << endl;
			}
		if (ans[x] == 2) {
			cout << "Friday" << endl;
		}
		if (ans[x] == 3) {
			cout << "Saturday" << endl;
		}
		if (ans[x] == 4) {
			cout << "Sunday" << endl;
		}
		if (ans[x] == 5) {
			cout << "Monday" << endl;
		}
		if (ans[x] == 6) {
			cout << "Tuesday" << endl;
		}
	}
}
