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