#include <iostream>

using namespace std;

int main()
{
	int month[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int m, d;
	
	while (true) {
		cin >> m >> d;
		if (m==0 || d==0) break;
		
		int day = 3; // 2013/12/31 is Wednesday
		
		for (int i=0; i<m-1; i++) day += month[i];
		day += d;
		
		switch (day%7) {
		case 0 :
			cout << "Sunday"; break;
		case 1 :
			cout << "Monday"; break;
		case 2 :
			cout << "Tuesday"; break;
		case 3 :
			cout << "Wednesday"; break;
		case 4 :
			cout << "Thursday"; break;
		case 5 :
			cout << "Friday"; break;
		case 6 :
			cout << "Saturday"; break;
		}
		cout << endl;
	}
	
	return 0;
}