#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;

int main() {
	int m, d,n;
	while (1) {
		cin >> m >> d;
		if (m == 0)
			break;
		n = d-1;
		switch (m) {
		case 12:
			n += 30;
		case 11:
			n += 31;
		case 10 :
			n += 30;
		case 9:
			n += 31;
		case 8:
			n += 31;
		case 7:
			n += 30;
		case 6:
			n += 31;
		case 5 :
			n += 30;
		case 4:
			n += 31;
		case 3:
			n += 29;
		case 2:
			n += 31;
		}
		switch (n % 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;
		}
	}
}
