def hit(str1, str2)
  n = 0
  
  4.times do |i|
    n += 1 if str1[i] == str2[i]
  end
  
  return n
end

def blow(str1, str2)
  n = 0
  
  4.times do |i|
    n += 1 if str1.include?(str2[i])
  end
  
  return n
end

loop do
  str = gets.split
  
  break if str == ["0", "0"]
  
  puts "#{hit(str[0], str[1])} #{blow(str[0], str[1])}"
end