#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#define EPS 1e-10
using namespace std;
typedef long long llong;
void whatday(int x, int y) {
	if (x % 7 == y % 7)cout << "Monday" << endl;
	else if (x % 7 == (y + 1) % 7)cout << "Tuesday" << endl;
	else if (x % 7 == (y + 2) % 7)cout << "Wednesday" << endl;
	else if (x % 7 == (y + 3) % 7)cout << "Thursday" << endl;
	else if (x % 7 == (y + 4) % 7)cout << "Friday" << endl;
	else if (x % 7 == (y + 5) % 7)cout << "Saturday" << endl;
	else if (x % 7 == (y + 6) % 7)cout << "Sunday" << endl;
}
int main() {
	int m, d;
	while (cin >> m >> d&&m&&d) {
		int x = 0;
		if (m < 3) {
			x += (m - 1) * 31 + (d - 1);
			whatday(x, 4);
		}
		else {
			x += 31 + 29;// 3/1
			m -= 3; d--;
			x += 61 * (m / 2) + (m % 2) * 31 + d;
			whatday(x, 4);
		}
	}
	return 0;
}