#include<iostream>
using namespace std;

int main() {
	int m, d;
	while (cin >> m >> d&&m + d) {
		int days[11] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30 };
		int sum = -1;
		for (int i = 0; i < m - 1; i++) {
			sum += days[i];
		}
		sum += d;
		switch (sum % 7) {
		case 0: cout << "Thursday\n"; break;
		case 1: cout << "Friday\n"; break;
		case 2: cout << "Saturday\n"; break;
		case 3: cout << "Sunday\n"; break;
		case 4: cout << "Monday\n"; break;
		case 5: cout << "Tuesday\n"; break;
		case 6: cout << "Wednesday\n"; break;
		}
	}
}
