#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define endl '\n'
#define pb push_back
#define fi first
#define se second
#define all(c) (c).begin(),(c).end()
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define TRACE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

const ll inf = 2e18;
const int mod = 1e9 + 7;
const int N = 1e4 + 10;

int dp[N][2][100];

signed main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	string k;
	int d;
	cin >> k >> d;
	int n = k.length();
	dp[0][1][0] = 1;
	for(int i = 1; i <= n; i++) {
		int cur = k[i - 1] - '0';
		for(int j = 0; j <= 9; j++) {
			for(int rem = 0; rem < d; rem++) {
				dp[i][0][(rem + j) % d] = (dp[i][0][(rem + j) % d] + dp[i - 1][0][rem]) % mod;
				if(j < cur) {
					dp[i][0][(rem + j) % d] = (dp[i][0][(rem + j) % d] + dp[i - 1][1][rem]) % mod;
				}
				if(j == cur) {
					dp[i][1][(rem + j) % d] = (dp[i][1][(rem + j) % d] + dp[i - 1][1][rem]) % mod;
				}
			}
		}
	}
	cout << (dp[n][0][0] + dp[n][1][0] - 1 + mod) % mod;

	return 0;
}
#include<bits/stdc++.h>
using namespace std;
static const int64_t mod=1000000007;
int64_t f(int64_t x,int64_t y){
if(y==0)
  return 1;
  else if(y%2==0)
    return (f(x,y/2)*f(x,y/2))%mod;
  else
    return (x*((f(x,y/2)*f(x,y/2))%mod))%mod;
}
int64_t comb(int64_t n,int64_t k){
int64_t a=1;
  for(int64_t i=1;i<=k;i++){
  a=(a*(n+1-i))%mod;
    a=(a*f(i,mod-2))%mod;
  }return a;

}
int main(){
int64_t N,M,K;
  cin>>N>>M>>K;
  int64_t ans=0;
  for(int64_t i=1;i<M;i++)
    ans=(ans+i*(M-i))%mod;
  ans=(((ans*N)%mod)*N)%mod;
  int64_t ans1=0;
  for(int64_t i=1;i<N;i++)
    ans1=(ans1+i*(N-i))%mod;
  ans1=(((ans1*M)%mod)*M)%mod;
  ans=(ans+ans1)%mod;
  ans=(ans*comb(N*M-2,K-2))%mod;
  cout<<ans<<endl;
    return 0;
}