import std.stdio;
import std.string;
import std.conv,std.array,std.datetime;
void main(){

	while(1){
		auto cs = readln().chomp().split();
		if( cs[0]=="0" ){	break;	}
		final switch( Date( 2004, to!int(cs[0]), to!int(cs[1])).dayOfWeek() ){
		case 0:writeln("Sunday");break;
		case 1:writeln("Monday");break;
		case 2:writeln("Tuesday");break;
		case 3:writeln("Wednesday");break;
		case 4:writeln("Thursday");break;
		case 5:writeln("Friday");break;
		case 6:writeln("Saturday");break;
		}
	}

}