while true
n = gets.chomp.split
m = n[0].to_i
d = n[1].to_i
if m == 0
    break
end
if m == 1
    a = d % 7 
    elsif m == 2
    a = (d + 3) % 7
    elsif m == 3
    a = (d + 4) % 7
    elsif m == 4
    a = (d + 7) % 7
    elsif m == 5
    a = (d + 2) % 7
    elsif m == 6
    a = (d + 5) % 7
    elsif m == 7
    a = (d + 7) % 7
    elsif m == 8
    a = (d + 3) % 7
    elsif m == 9
    a = (d + 6) % 7
    elsif m == 10
    a = (d + 1) % 7
    elsif m == 11
    a = (d + 4) % 7
    elsif m == 12
    a = (d + 6) % 7
end


if a == 1
    puts "Thursday"
    elsif a == 2
    puts "Friday"
    elsif a == 3
    puts "Saturday"
    elsif a == 4
    puts "Sunday"
    elsif a == 5
    puts "Monday"
    elsif a == 6
    puts "Tuesday"
    elsif a == 0
    puts "Wednesday"
end
end

