def solve r,a
  hit = 0
  blow = 0
  r.size.times do |i|
    a.size.times do |j|
      if a[j] == r[i]
        if i == j
          hit += 1
        else
          blow += 1
        end
      end
    end
  end
  [hit, blow]
end

loop do
  r, a = $stdin.gets.chomp.split(" ")
  break if r === "0" || a === "0"
  result = solve r, a
  printf "%d %d\n", result[0], result[1]
end