for q in range(12000):

    a, b = input().split()

    if a[0] is '0' and b[0] is '0':

        break



    hit = 0

    for i in range(4):

        if a[i] is b[i]:

            hit = hit + 1



    blow = 0

    for j in range(4):

        for i in range(4):

            if (b[j] is a[i]) and (a[i] is not b[i]) and (a[j] is not b[j]):

                blow = blow + 1



    print((hit, blow))
for q in range(12000):

    a, b = input().split()

    if a[0] is '0' and b[0] is '0':

        break



    hit = sum(1 for c, d in zip(a, b) if d is c)

    blow = sum(1 for e in b if e in a) - hit

    print((hit, blow))
for q in range(12000):
    a, b = input().split()
    if a[0] is "0" and b[0] is "0":
        break
    hit = 0
    for i in range(4):
        if a[i] is b[i]:
            hit = hit + 1
    blow = 0
    for j in range(4):
        for i in range(4):
            if (b[j] is a[i]) and (a[i] is not b[i]) and (a[j] is not b[j]):
                blow = blow + 1
    print((hit, blow))

for q in range(12000):
    a, b = input().split()
    if a[0] is "0" and b[0] is "0":
        break
    hit = sum(1 for c, d in zip(a, b) if d is c)
    blow = sum(1 for e in b if e in a) - hit
    print((hit, blow))

-    hit = 0 -    for i in range(4): -        if a[i] is b[i]: -            hit = hit + 1 -    blow = 0 -    for j in range(4): -        for i in range(4): -            if (b[j] is a[i]) and (a[i] is not b[i]) and (a[j] is not b[j]): -                blow = blow + 1 +    hit = sum(1 for c, d in zip(a, b) if d is c) +    blow = sum(1 for e in b if e in a) - hit