#encoding:utf-8 No.0027 2014.10.6
def count_days(month)
  m = 1
  days = 0
  until m == month
    if m == 2
      days += 29
    elsif m%2 == 0
      days += 30
    else
      days += 31
    end
    m += 1
  end
  return days
end

ary = []
while (date =  gets.chomp.split.map{|item| item = item.to_i}) != [0,0]
  ary.push date
end

ary.length.times do |i|
  month,day = ary[i]
  day += count_days(month)
  case day%7
  when 1
    puts "Thursday"
  when 2
    puts "Friday"
  when 3
    puts "Saturday"
  when 4
    puts "Sunday"
  when 5
    puts "Monday"
  when 6
    puts "Tuesday"
  else
    puts "Wednesday"
  end
end