Problem I
Hidden Truth in Recurrence
Time Limit: 1 second

You are given a recursive function, which has the following form:

Now, you have to find: , where

Input
There will be less than 1001 lines of inputs in the input file. Each line will contain three integers: k (0<k<1019), n (0<n<1019) and t (0<t<10). Input will be terminated by three zeros for the value of k, n and t. You must not process this case.

Output
For each line of input, output the value of x. The output should be in the format shown in the sample output.

Sample Input Sample Output
1234 1234 4
2323 99999999999 8
4 99999 9
888 888 8
0 0 0
Case #1: 736
Case #2: 39087387
Case #3: 494777344
Case #4: 91255296


Problemsetter: Tanbir Ahmed, special thanks to Monirul Hasan