let () =
  let idx = [0; 1; 2; 3] in
  let rec f () =
    try
      let s = read_line() in
      let ax = Scanf.sscanf s "%d %d %d %d" (fun a b c d -> [a; b; c; d]) in
      let s = read_line() in
      let bx = Scanf.sscanf s "%d %d %d %d" (fun a b c d -> [a; b; c; d]) in
      let g (h, b) vb i =
        let gg (h, b) va j =
          if va = vb then
            if i = j then (h+1, b) else (h, b+1)
          else
            (h, b)
        in
        let (h, b) = List.fold_left2 gg (h, b) ax idx in
        (h, b)
      in
      let (h, b) = List.fold_left2 g (0, 0) bx idx in
      Printf.printf "%d %d\n" h b;
      f ()
    with
    | End_of_file -> ()
  in
  f ()