import std.datetime, std.string, std.conv, std.algorithm, std.stdio;

enum Week = [
    "Sunday",
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday",
];
void main()
{
    foreach(line;stdin.byLine)
    {
        auto input = line.split.map!(to!int);
        if(input[0] == 0 && input[1] == 0) break;
        Week[Date(2004, input[0], input[1]).dayOfWeek].writeln;
    }
}