# AOJ 0226: Hit and Blow

# Python3 2018.6.23 bal4u



while 1:

	r, a = input().split()

	if r == '0': break

	h, sr, sa = 0, set(), set()

	for i in range(4):

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

		else:

			sr.add(r[i])

			sa.add(a[i])

	print((h, len(sr & sa)))

# AOJ 0226: Hit and Blow

# Python3 2018.6.25 bal4u



while 1:

	r, a = input().split()

	if r == '0': break

	h = 0

	for i in range(4):

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

	print((h, len(set(r) & set(a))-h))

# AOJ 0226: Hit and Blow
# Python3 2018.6.23 bal4u
while 1:
    r, a = input().split()
    if r == "0":
        break
    h, sr, sa = 0, set(), set()
    for i in range(4):
        if r[i] == a[i]:
            h += 1
        else:
            sr.add(r[i])
            sa.add(a[i])
    print((h, len(sr & sa)))

# AOJ 0226: Hit and Blow
# Python3 2018.6.25 bal4u
while 1:
    r, a = input().split()
    if r == "0":
        break
    h = 0
    for i in range(4):
        if r[i] == a[i]:
            h += 1
    print((h, len(set(r) & set(a)) - h))

-# Python3 2018.6.23 bal4u +# Python3 2018.6.25 bal4u -    h, sr, sa = 0, set(), set() +    h = 0 -        else: -            sr.add(r[i]) -            sa.add(a[i]) -    print((h, len(sr & sa))) +    print((h, len(set(r) & set(a)) - h))