#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
int main() {
  cin.tie(0);
  cout << fixed << setprecision(10);
  while(1) {
    string s; cin >> s;
    if(s == "0") break;
    string t, u; cin >> t >> u;
    int n = s.size();
    vector<int> a(n), b(n), c(n);
    for(int i=0;i<n;++i) {
      if(s[i] == '?') a[i] = -1;
      else a[i] = s[i] - '0';
    }
    for(int i=0;i<n;++i) {
      if(t[i] == '?') b[i] = -1;
      else b[i] = t[i] - '0';
    }
    for(int i=0;i<n;++i) {
      if(u[i] == '?') c[i] = -1;
      else c[i] = u[i] - '0';
    }
    reverse(a.begin(), a.end());
    reverse(b.begin(), b.end());
    reverse(c.begin(), c.end());
    vvll dp(n+1, vll(2, 0));
    dp[0][0] = 1;
    for(int d=0;d<n;++d) {
      for(int i=0;i<=9;++i) {
        if(d == n-1 && i == 0) continue;
        for(int j=0;j<=9;++j) {
          if(d == n-1 && j == 0) continue;
          for(int k=0;k<=9;++k) {
            if(d == n-1 && k == 0) continue;
            if((a[d] == -1 || a[d] == i) &&
                (b[d] == -1 || b[d] == j) &&
                (c[d] == -1 || c[d] == k)) {
              if((i + j) % 10 == k) dp[d+1][(i + j) / 10] += dp[d][0];
              if((i + j + 1) % 10 == k) dp[d+1][(i + j + 1) / 10] += dp[d][1];
              dp[d+1][0] %= MOD;
              dp[d+1][1] %= MOD;
            }
          }
        }
      }
    }
    cout << dp[n][0] << endl;
  }
}

