require 'scanf'
require 'date'

wd = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ]

while line = gets do
  m, d = line.split.map(&:to_i)
  break if m == 0 || d == 0
  puts wd[Date.new(2004,m,d).wday-1]
end