import Control.Applicative

dayCount x
  | x == 1 = 0
  | x == 2 = 31 + dayCount (x-1)
  | x == 3 = 29 + dayCount (x-1)
  | x == 4 = 31 + dayCount (x-1)
  | x == 5 = 30 + dayCount (x-1)
  | x == 6 = 31 + dayCount (x-1)
  | x == 7 = 30 + dayCount (x-1)
  | x == 8 = 31 + dayCount (x-1)
  | x == 9 = 31 + dayCount (x-1)
  | x == 10 = 30 + dayCount (x-1)
  | x == 11 = 31 + dayCount (x-1)
  | x == 12 = 30 + dayCount (x-1)
  | otherwise = 0

sumDay :: [Int] -> Int
sumDay (x:xs) = (dayCount x) + (head xs)

whatDay x = do
  let day = sumDay x
  if day == 0
    then putStr ""
    else case mod day 7 of 0 -> putStrLn "Wednesday"
                           1 -> putStrLn "Thursday"
                           2 -> putStrLn "Friday"
                           3 -> putStrLn "Saturday"
                           4 -> putStrLn "Sunday"
                           5 -> putStrLn "Monday"
                           6 -> putStrLn "Tuesday"

main = do
  input <- fmap (fmap (read :: String -> Int) . words) . lines <$> getContents
  mapM_ whatDay input