import Data.List
deleteAll ch str = if elem ch str then deleteAll ch (delete ch str) else str

saveRange::Int -> Int -> [[a]] -> [[a]]
saveRange a b c = [ x | x<-c, length x>=a, length x<=b ]

func::[String] -> [String]
func strs = saveRange 3 6 strs

main = do{
    getLine>>=putStrLn.unwords.func.words.(',' `deleteAll`).('.' `deleteAll`);
}