import Data.List as List
import Data.Set as Set
import Control.Applicative
import Control.Monad

f :: [Int] -> [Int] -> (Int, Int)
f xs ys = (hit, blow - hit)
  where
  hit = length $ List.filter id $ zipWith (==) xs ys
  blow = size $ intersection (fromList xs) (fromList ys)

chunksOf n [] = []
chunksOf n xs = (List.take n xs):chunksOf n (List.drop n xs)

main = do
  ss <- fmap (fmap read) <$> fmap words <$> lines <$> getContents :: IO [[Int]]
  mapM_ (\(x, y) -> putStrLn $ show x ++ " " ++ show y) $ fmap (\xs -> f (xs!!0) (xs!!1)) $ chunksOf 2 ss
