let () =
  let rec read () =
    let hit = ref 0 and
        blow = ref 0 and
        (x,y) = Scanf.scanf " %s %s\n" (fun x y -> (x,y)) in
    if x = "0" && y = "0" then ()
    else
      begin
        for i = 0 to (String.length x)-1 do
          if x.[i] = y.[i] then incr hit
          else
            for j = 0 to (String.length y)-1 do
              if x.[i] = y.[j] then incr blow
            done
        done;
        Printf.printf "%d %d\n" (!hit) (!blow);
        read ()
      end
  in read ()
;;