Day = %w[
	Sunday
	Monday
	Tuesday
	Wednesday
	Thursday
	Friday
	Saturday
]

$<.each_line do |line|
	month, day = line.split.map(&:to_i)
	break if month.zero?

	puts Day[Time.new(2004, month, day).wday]
end