import Data.List
main = getContents >>= mapM (putStrLn . caesar_cipher) . lines
caesar_cipher = unwords . head . filter (\ws -> intersect ws keys /= []) . map words . iterate (map shift)
 where
  keys = ["the", "the.", "this", "this.", "that", "that."] 
  shift c
   | notElem c ['a'..'z'] = c
   | c=='z' = 'a'
   | otherwise = succ c