In the ACM-ICPC World Finals 2012, the UPC team made as usual a nice set of mistakes. One of them was the original assumption that . Observe that this equation has two interesting properties:
The right-hand side of the equation is the result of removing one digit from the real result (in the example, 2500).
At least one of the two numbers of the left-hand side of the equation has at least one digit such that, if removed, makes the equation correct (in the example, ).
Let us call an equation a fail when it fulfills properties 1 and 2, and an epic fail when it only fulfills property 1. For instance, is an epic fail. Please write a program to count the number of fails and epic fails that the UPC teams can make at the ACM-ICPC World Finals. ( The real number is of course , but let us use the simplifications of the statement. )
Input consists of several cases. Every case has two numbers and with the same number of digits . Those numbers can have leading zeroes. Assume .
For every case, print the number of different fails and epic fails of the kind . Note that must have length exactly , if necessary by adding leading zeroes.
Input
50 50 002 003 9999 9999 0000 0000 100 111 0123456789 9876543210 21212121212121 40000000000000
Output
1 2 2 0 0 4 1 0 2 1 2 16 15 1