import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.range;
import std.container;
import std.bigint;
import std.math;
import std.datetime;

void main()
{
	int[] a;
	auto week = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
	while (a = readln.split.map!(to!int).array, a[0]) {
		week[Date(2004, a[0], a[1]).dayOfWeek].writeln;
	}
}