import Data.List

main = do
    inputs <- getContents
    let probs = get2.map (map read.words).lines $ inputs
    mapM_ putStrLn $ map ((\(h,b) -> unwords [show h,show b]).(\[a,b] -> hitAndBlow a b)) $ probs
        where 
            get2 []  = []
            get2 lst = take 2 lst : get2 (drop 2 lst)

hitAndBlow :: [Int] -> [Int] -> (Int, Int)
hitAndBlow n1 n2 = (hit,blow)
    where
        hit = length.filter (== True) $ zipWith (==) n1 n2
        blow = subtract hit.length $ intersect n1 n2