while x = gets.chomp.split(" ")
   s = x[0]
   t = x[1]
   break if s=="0" && t=="0"
   a = Array.new(10,-1)
   hit = 0
   blow = 0
   for i in 0..3
     a[s[i].to_i] = i
   end
   for i in 0..3
     if a[t[i].to_i] == i
       hit = hit + 1
     elsif a[t[i].to_i] != -1 
       blow = blow + 1
     end
   end
   print(hit," ",blow,"\n")
end
