import std.stdio, std.string, std.conv;
import std.array, std.algorithm, std.range;

void main()
{
    immutable string[7] W = [
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday",
        "Sunday"];
    immutable int[12] D = [0,31,29,31,30,31,30,31,31,30,31,30];
    foreach(s;stdin.byLine())
    {
        auto md = s.split().map!(to!int);
        immutable m=md[0],d=md[1];
        if(m==0 && d==0) break;
        W[(D[0..m].reduce!"a+b"()+d+2)%7].writeln();
    }
}