import scala.io.StdIn.readLine

object Main {

  def play(sb:StringBuilder):Unit = {
    val r = readLine.split(" ")
    if(r(0).toInt==0 && r(1).toInt==0) print(sb.result)
    else {
      var hit = 0
      var blow = 0
      for(i<-0 until r(0).length) {
        if(r(0)(i) == r(1)(i)) hit += 1
        else {
          for(j<-0 until r(1).length) {
            if(r(0)(i) == r(1)(j)) blow += 1
          }
        }
      }
      sb.append(hit + " " + blow + "\n")
      play(sb)
    }
  }

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