day=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
while true
	m,d=gets.chomp.split(" ").map{|s| s.to_i}
	break if m==0&&d==0
	count=2
	for i in (1..m-1) do
		if(i==2) then 
			count+=29
		elsif (i==4||i==6||i==9||i==11) then
			count+=30
		else
			count+=31
		end	
	end
	count+=d
	count%=7
	puts day[count]
end
