Dzoni, a wise man from Serbia, knows the answers for all of the world's questions except one ?! Can you solve this question for him:
On the first day you are given a number A. Every following day, your number A will be changed in following way: A=(A+ biggestDigit(A)) mod M. Can you predict the number at the N-th day?
The function biggestDigit(A) returns the digit with the biggest value in the number A. For example: biggestDigit(172)=7.
The single line of input contains three numbers, A (1≤A<M), M (1≤M≤1018) and N (1≤N≤1018).
In the single line, print the value of A at the N-th day.