import std.stdio;
import std.string;
import std.math;
import std.conv;
import std.algorithm;
import std.bigint;

void main(){

    int d,m;
    int date = 2;
    auto ds = ["Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday","Monday"];
    auto a = [31,29,31,30,31,30,31,31,30,31,30,31];
    while(true){
	date = 2;
	auto s = split(readln());
	d = to!int(s[0]);
	m = to!int(s[1]);
	if(d == 0 && m == 0) break;
	for(int i=0;i<d-1;i++){
	    date += a[i];
	}
	    date += m-1;
	date = date % 7;
	writeln(ds[date]);
    }
}