mday = [31,29,31,30,31,30,31,31,30,31,30,31]
week = ["Monday", "Tuesday", "Wednesday", "Thrusday", "Friday", "Saturday", "Sunday"]
until (m,d = gets.split.map(&:to_i)) == [0,0]
  day = 2 # ????????\???0, 1???0??\????°´?????\???2
  (m-1).times do |i|
    day = day + mday[i]
  end

  day =(day + d) % 7
  puts week[day]
end