#include #define rep(i, n)for(int i=0,i<(n);++i) using namespace std; using ll = long long; int f(int n, int m){ int d = 0; while(m>0){ d = n%10; n /= 10; m--; } return d; } const ll MOD = 1e9+7; int main(){ int a, b, n; cin >> a >> b >> n; ll ans = 1; for(int i = 0; i < pow(10, n); i++){ ll now = 10*9*8*7*6*5*4*3*2; bool flag = true; for(int j = 1; j <= n; j++){ int digit = f(i, j) + 1; if(a<=digit && digit<=b) now = gcd(now, digit); else flag = false; } if(flag) ans = (ans * now)%MOD; } cout << ans << endl; return 0; }