open Printf
open Scanf
       
module IntSet = Set.Make(struct
                          type t = int
                          let compare x y = x - y
                        end)

let () =
  let rec loop () =
    begin
      match scanf "%d %d %d %d " (fun w x y z -> [w; x; y; z]) with
        a -> let b = scanf "%d %d %d %d " (fun w x y z -> [w; x; y; z]) in
             let sa = IntSet.of_list a
             and sb = IntSet.of_list b in
             let hitn = List.fold_left (+) 0 (List.map2 (fun x y -> if x = y then 1 else 0) a b) in
             let blown = IntSet.cardinal (IntSet.inter sa sb) - hitn in
             printf "%d %d\n" hitn blown;
             loop ()
      | exception End_of_file -> ()
    end
  in
  loop ()