wdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
loop do
	xs = gets.split.map{|v| v.to_i}
	if xs[0] == 0 && xs[1] == 0 then break; end
	puts wdays[Time.new(2004, xs[0], xs[1]).wday]
end