loop do
  ans,res=gets.split
  break if(ans.to_i | res.to_i)==0
  hit=0
  blow = 0
  ans.size.times do |i|
    hit+=1 if ans[i]==res[i]
  end
  ans.each_char do |c|
    blow+=1 if res.include? c
  end
  print hit," ",blow-hit,"\n"
end