import Data.List
main = interact $ unlines . map (unwords . map show . hit_and_blow) . fin [] . lines
fin acc xs = reverse $ case xs of {[] -> acc; (a:b:ns) -> fin ([words a, words b]:acc) ns} 
hit_and_blow [as,bs] = [hit, blow]
 where
  hit = length $ filter (== True) $ zipWith (== )as bs
  blow = length (intersect as bs) - hit