def countdays m, d
    sum = 0
    days = [31,29,31,30,31,30,31,31,30,31,30,31]
    0.upto(m-2){|i| sum += days[i]}
    sum += d
    sum
end

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

while true
    m, d = gets.chomp.split.map(&:to_i)
    break if m == 0
    puts yobi[countdays(m, d) % 7]
end
