406995: GYM102672 C Spell
Memory Limit:512 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
C. Spelltime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output
Maleficent got upset when she could not cancel the spell cast upon Aurora because it's infinite and unbreakable. Luckily for us it's not such a big problem because in our version of the story all spells are mathematically described and can be cancelled much easier.
The spell is determined by two positive integer numbers $$$a$$$ and $$$b$$$. The process of cancelling the spell goes as follows:
- Multiply numbers from $$$a$$$ to $$$b$$$ inclusive
- Count the sum of digits of the result
- If the sum of digits isn't less then $$$10$$$, go to step $$$2$$$
To finish the cancellation rite, you need to say the resulting number. Please, help Maleficent to find it.
InputThe first line contains number $$$a$$$, the second — number $$$b$$$ ($$$1 \le a \le b < 10^{100\,000}$$$). Both numbers have no leading zeros.
OutputOutput the resulting number.
ExamplesInput1 5Output
3Input
6 8Output
3