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

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