names = [ "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur", "Sun" ]
lengths = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

day [m, d] = (names !! ((ndays + offset) `mod` 7)) ++ "day"
  where ndays  = sum (take (m - 1) lengths) + d - 1  -- num of days from Jan/1
        offset = 3  -- the day of 2004/Jan/1

main = do
  s <- getLine
  if s == "0 0"
     then return ()
     else do putStrLn . day . map read . words $ s
             main