#include <bits/stdc++.h>
using namespace std;
void gcd(long long a, long long b, long long &d, long long &x, long long &y) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
  } else {
    gcd(b, a % b, d, y, x);
    y -= x * (a / b);
  }
}
long long com[1000005];
int fuck = 0;
long long a = 1000000007, b, x, y, d, n;
long long f(long long sum) {
  long long ans = 0;
  if (sum > b * n) return 0;
  if (sum != 0 && (sum - a * n) % (b - a) == 0 && sum >= a * n) {
    fuck++;
    long long y = (sum - a * n) / (b - a);
    ans = (ans + com[y]) % 1000000007;
  }
  ans = (ans + f(sum * 10 + a)) % 1000000007;
  ans = (ans + f(sum * 10 + b)) % 1000000007;
  return ans;
}
int main() {
  long long aa, bb;
  cin >> aa >> bb >> n;
  com[1] = n;
  com[0] = 1;
  for (b = 2; b <= 1000000; b++) {
    gcd(a, b, d, x, y);
    while (y < 0) y += a;
    com[b] = ((com[b - 1] * (n - b + 1)) % 1000000007 * y) % 1000000007;
  }
  a = aa;
  b = bb;
  fuck = 0;
  cout << f(0) << endl;
  return 0;
}
