main = getContents >>= putStrLn . (\x -> shows (sum $ fst x) " " ++ show (sum $ snd x)) . (\xs -> unzip [ if a > b then (3,0) else if a < b then (0,3) else (1,1) | [a,b] <- xs]) . map words . tail . lines