#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <cstring>
#include <queue>
#include <math.h>
#include <iterator>
using namespace std;

int main() {
	int c[12] = { 31,29,31,30,31,30,31,31,30,31,30,31 };
	while (true) {
		int a, b,d = 0;
		scanf("%d%d", &a, &b);
		if (a == 0) goto end;
		d = b;
		for (int i = 0;i < a-1;++i) {
			d += c[i];
		}
		if (d%7 == 6) {
			printf("Tuesday\n");
		}
		else if (d % 7 == 0) {
			printf("Wednesday\n");
		}
		else if (d % 7 == 1) {
			printf("Thursday\n");
		}
		else if (d % 7 == 2) {
			printf("Friday\n");
		}
		else if (d % 7 == 3) {
			printf("Saturday\n");
		}
		else if (d % 7 == 4) {
			printf("Sunday\n");
		}
		else if (d % 7 == 5) {
			printf("Monday\n");
		}
	}
end:;
}
