import scala.io.StdIn.readLine
import scala.collection.mutable.ArrayBuffer

object Main {
  def hitblow(a:List[String],b:List[String],hit:List[String]):(Int,Int) =
    (a,b) match {
      case (Nil,Nil) => (hit.length, (a intersect b).length)
      case (hd::tl,hd2::tl2) => hitblow(tl,tl2,if(hd==hd2) hd::hit else hit)
      case (_,_) => (0,0)
    }


  def play(sb:StringBuilder):Unit = {
    val r = readLine

    if(r==null)  print(sb.result)
    else {
      val buf = ArrayBuffer.empty[String]
      val a = r.split(" ")
      val b = readLine.split(" ")
      for( i <- 0 until a.length)  if(a(i) == b(i)) buf += a(0)

      val x = buf.toArray.length
      val y = a.intersect(b).length - x
      sb.append(x + " " + y + "\n")
      play(sb)
    }
  }

  def main(args:Array[String]) = play(new StringBuilder)
}