while 1:

    r,a=input().split()

    if r=='0' and a=='0': break

    h = b = 0

    for i in range(4):

        if r[i]==a[i]: h+=1

    for i in range(10):

        b += min(r.count(chr(ord('0')+i)),a.count(chr(ord('0')+i)))

    print(h,b-h)
while 1:

    r,a=input().split()

    if r=='0' and a=='0': break

    h = b = 0

    for i in range(4):

        if r[i]==a[i]: h+=1

    for s in r:

        for t in a:

            if s==t:

                b+=1; break;

    print(h,b-h)
while 1:
    r, a = input().split()
    if r == "0" and a == "0":
        break
    h = b = 0
    for i in range(4):
        if r[i] == a[i]:
            h += 1
    for i in range(10):
        b += min(r.count(chr(ord("0") + i)), a.count(chr(ord("0") + i)))
    print(h, b - h)

while 1:
    r, a = input().split()
    if r == "0" and a == "0":
        break
    h = b = 0
    for i in range(4):
        if r[i] == a[i]:
            h += 1
    for s in r:
        for t in a:
            if s == t:
                b += 1
                break
    print(h, b - h)

-    for i in range(10): -        b += min(r.count(chr(ord("0") + i)), a.count(chr(ord("0") + i))) +    for s in r: +        for t in a: +            if s == t: +                b += 1 +                break