import std.stdio,std.conv,std.datetime,std.algorithm,std.string,std.array;void main(){int[] a;auto w=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"];while(a=readln.split.map!(to!int).array,a[0])writeln(w[Date(2004,a[0],a[1]).dayOfWeek]~"day");}