### main

while true
  r, a = gets.strip.split(' ')
  break if r == '0' && a == '0'

  hit = blow = 0

  for i in (0..3)
    if r[i] == a[i]
      hit += 1
    elsif r.include? a[i]
      blow += 1
    end
  end

  puts [hit, blow].join(' ')
end