<?php

  $result = Array();

  // input
  do{
    $stdinA = trim(fgets(STDIN));  
    $stdinB = trim(fgets(STDIN));  

    $aSanAr = explode(" ", $stdinA);
    $bSanAr = explode(" ", $stdinB);

    $hitCount = 0;
    $blowCount = 0;

    for($i=0; $i<count($aSanAr); $i++){
      if($aSanAr[$i] == $bSanAr[$i]){
        $hitCount++;
      }else if(in_array($bSanAr[$i], $aSanAr)){
        $blowCount++;
      }
    }

    $result[] =  $hitCount.' '.$blowCount;

  }while($stdinA != "" && $stdinB != "");

  for($i=0; $i<count($result); $i++){
    echo $result[$i]."\n";
  }