import Control.Monad
import Data.List

main :: IO ()
main = do
  n <- readLn
  ws <- replicateM n $ fmap words getLine
  putStrLn $ unwords $ map (show . sum) $ transpose $ map judge ws
    where judge [a, b] | a > b = [3, 0]
                       | a < b = [0, 3]
                       | otherwise = [1, 1]