while true
    r, a = gets.chomp.split()
    break if [r, a] == ["0", "0"]
    hit = 0
    4.times{|i| hit += 1 if r[i] == a[i]}
    hazure = (r.split("") - a.split("")).length
    puts "#{hit} #{4 - hazure - hit}"
end
