main=do getContents>>=putStr.unlines.map (show.foldl1(*).map read.words.filter(/=',')).lines