while true do
    r, a = gets.chomp.split
    break if r == '0' && a == '0'
    
    h = 0
    b = 0
    
    4.times do |i|
        if a[i] == r[i] then
            h += 1
        elsif r.include?(a[i]) then
            b += 1
        end
    end
    
    print h.to_s + " " + b.to_s + "\n"
end