import Data.List
import Control.Applicative
import Control.Monad

splitArgs :: [a] -> [[a]]
splitArgs [] = []
splitArgs (a1 : a2 : r) = [[a1, a2]] ++ splitArgs r

judge :: [String] -> [Int]
judge (a1 : a2 : a3 : a4 : b1 : b2 : b3 : b4 : _) = [hit, blow]
    where
        a = [a1, a2, a3, a4]
        b = [b1, b2, b3, b4]
        hit = length $ filter (\(x, y) -> x == y) $ zip a b
        blow = (length $ intersect a b) - hit

main :: IO ()
main = interact $ unlines . map unwords . map (map show) . map judge . map concat . map (map words) . splitArgs . lines