#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <iostream>


using namespace std;

int main()
{
	int m, d;
	while (true)
	{
		scanf("%d %d", &m, &d);
		if (m == 0 && d == 0)
			break;

		int total = d;
		for (int i = 1; i < m; ++i)
		{
			if (i == 2)
				total += 29;
			else if (i & 1 || i == 8)
				total += 31;
			else
				total += 30;
		}
		char* days[] = { "Monday", "Tuesday", "Wednesday", "Thursday",
			"Friday", "Saturday", "Sunday" };
		puts(days[(total+2)%7]);
	}
	return 0;
}