#d2669. 完美数

完美数

Perfect Number

Problem Description

For given digits a,ba, b, when every decimal digit of an integer nn is either aa or bb, we call nn a "good number".

For a good number nn, when the sum of all its decimal digits is also a "good number", we call nn a "perfect number".

Find how many mm-digit numbers are "perfect numbers".

Input Format

A single line containing three integers a,b,ma, b, m (1≤m≤1061 \le m \le 10^6, 1≤a,b≤91 \le a, b \le 9).

Output Format

Output one integer: the number of perfect numbers. Since the answer may be very large, output it modulo 109+710^9 + 7.

Sample Input

5 1 5

Sample Output

1

Sample Explanation

Only 1111111111 satisfies the requirement.