#include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;




const int mod = 1000000007;
struct Mod {
public:
  int num;
  Mod() : num(0) { ; }
  Mod(long long int n) : num((n % mod + mod) % mod) { ; }
  Mod(int n) : num((n % mod + mod) % mod) { ; }
  operator int() { return num; }
};

Mod operator+(const Mod a, const Mod b) { return Mod((a.num + b.num) % mod); }
Mod operator+(const long long int a, const Mod b) { return Mod(a) + b; }
Mod operator+(const Mod a, const long long int  b) { return b + a; }
Mod operator++(Mod &a) { return a + Mod(1); }
Mod operator-(const Mod a, const Mod b) { return Mod((mod + a.num - b.num) % mod); }
Mod operator-(const long long int a, const Mod b) { return Mod(a) - b; }
Mod operator--(Mod &a) { return a - Mod(1); }
Mod operator*(const Mod a, const Mod b) { return Mod(((long long)a.num * b.num) % mod); }
Mod operator*(const long long int a, const Mod b) { return Mod(a)*b; }
Mod operator*(const Mod a, const long long int b) { return Mod(b)*a; }
Mod operator*(const Mod a, const int b) { return Mod(b)*a; }
Mod operator+=(Mod &a, const Mod b) { return a = a + b; }
Mod operator+=(long long int &a, const Mod b) { return a = a + b; }
Mod operator-=(Mod &a, const Mod b) { return a = a - b; }
Mod operator-=(long long int &a, const Mod b) { return a = a - b; }
Mod operator*=(Mod &a, const Mod b) { return a = a * b; }
Mod operator*=(long long int &a, const Mod b) { return a = a * b; }
Mod operator*=(Mod& a, const long long int &b) { return a = a * b; }
Mod operator^(const Mod a, const int n) {
  if (n == 0) return Mod(1);
  Mod res = (a * a) ^ (n / 2);
  if (n % 2) res = res * a;
  return res;
}
Mod mod_pow(const Mod a, const int n) {
  if (n == 0) return Mod(1);
  Mod res = mod_pow((a * a), (n / 2));
  if (n % 2) res = res * a;
  return res;
}
Mod inv(const Mod a) { return a ^ (mod - 2); }
Mod operator/(const Mod a, const Mod b) {
  assert(b.num != 0);
  return a * inv(b);
}
Mod operator/(const long long int a, const Mod b) {
  assert(b.num != 0);
  return Mod(a) * inv(b);
}
Mod operator/=(Mod &a, const Mod b) {
  assert(b.num != 0);
  return a = a * inv(b);
}

#define MAX_MOD_N 1024000

Mod fact[MAX_MOD_N], factinv[MAX_MOD_N];
void init() {
  fact[0] = Mod(1); factinv[0] = 1;
  for (int i = 0; i < MAX_MOD_N - 1; ++i) {
    fact[i + 1] = fact[i] * Mod(i + 1);
    factinv[i + 1] = factinv[i] / Mod(i + 1);
  }
}
Mod comb(const int a, const int b) {
  return fact[a] * factinv[b] * factinv[a - b];
}

int main() {
  
  /*int N; cin >> N;
  vector<int>as;
  vector<int>num(10001);
  for (int i = 0; i < N; ++i) {
    int a; scanf("%d", &a);
    num[a]++;
  }
  vector<long long int>nums;
  for (int i = 0; i < 10001; ++i) {
    if (num[i] > 1) {
      string st(to_string(i)+to_string(i));
      nums.push_back(stoll(st));
      if (num[i] >= 3) {
        nums.push_back(stoi(st));
        nums.push_back(stoi(st));
      }
    }
    else if (num[i]) {
      for (int j = 0; j < 10001; ++j) {
        if (i == j)continue;
        if (num[j]) {
          int atime = min(3,num[i] * num[j]);
          string st(to_string(i) + to_string(j));
          for (int i = 0; i < atime; ++i) {

            nums.push_back(stoll(st));
          }
        }
      }
    }
  }
  for (int i = 0; i < 2; ++i) {

    auto it = min_element(nums.begin(), nums.end());
    nums.erase(it);
  }
  auto it = min_element(nums.begin(), nums.end());
  cout << *it << endl;
  return 0;*/
  while (1) {
    vector<string> sts(3); cin >> sts[0];
    if (sts[0] == "0")break;
    cin>> sts[1] >> sts[2];

    Mod dp[2000][2];
    dp[sts[0].size()][0] = 1;
    for (int keta = sts[0].size() - 1; keta >= 0; --keta) {
      vector<char>cs(3);
      cs[0] = sts[0][keta];
      cs[1] = sts[1][keta];
      cs[2] = sts[2][keta];
      vector<int>froms(3);
      vector<int>tos(3);
      for (int i = 0; i < 3; ++i) {
        if (cs[i] == '?') {
          froms[i] = 0;
          if (keta == 0)froms[i] = 1;
          tos[i] = 9;
        }
        else {
          froms[i] = cs[i] - '0';
          if (keta == 0)froms[i] = max(froms[i], 1);
          tos[i] = cs[i] - '0';
        }
      }
      for (int agari = 0; agari < 2; ++agari) {
        for (int a = froms[0]; a <= tos[0]; ++a) {
          for (int b = froms[1]; b <= tos[1]; ++b) {
            for (int c = froms[2]; c <= tos[2]; ++c) {
              if (a + b + agari == c) {
                dp[keta][0] += dp[keta + 1][agari];
              }
              else if (a + b + agari == c + 10) {
                dp[keta][1] += dp[keta + 1][agari];
              }
            }
          }
        }
      }
    }
    Mod ans = dp[0][0];
    cout << ans << endl;
  }
  
  return 0;
}