#include <iostream>
#include <vector>
using namespace std;

bool in_range(int a, int b){
  return a >= 0 && a < b;
}

int main(){
  string A;
  while(cin >> A, A != "0"){
    string B, C;
    cin >> B >> C;
    int n = A.length(), mod = 1e9 + 7;
    vector< vector<long long int> > dp(n, vector<long long int>(2,0));
    for(int i = n-1; i >= 0; --i){
      if(C[i] != '?'){
        int c = C[i] - '0';
        if(A[i] != '?' && B[i] != '?'){
          int a = A[i] - '0', b = B[i] - '0';
          if(i == 0 && (a == 0 || b == 0)) continue;
          if(a + b == c){
            if(i < n-1){
              dp[i][0] += dp[i+1][0];
              dp[i][0] %= mod;
            }else{
              ++dp[i][0];
              dp[i][0] %= mod;
            }
          }
          if(i < n-1 && a + b + 1 == c){
            dp[i][0] += dp[i+1][1];
            dp[i][0] %= mod;
          }
          if(a + b == 10 + c){
            if(i < n-1){
              dp[i][1] += dp[i+1][0];
              dp[i][1] %= mod;
            }else{
              ++dp[i][1];
              dp[i][1] %= mod;
            }
          }
          if(i < n-1 && a + b + 1 == 10 + c){
            dp[i][1] += dp[i+1][1];
            dp[i][1] %= mod;
          }
        }else if(A[i] != '?'){//B[i] == '?'
          int a = A[i] - '0', b = c - a, b_ = c - a + 10;
          if(i == 0 && (a == 0 || b == 0)) continue;
          if(in_range(b,10)){
            if(i < n-1){
              dp[i][0] += dp[i+1][0];
              dp[i][0] %= mod;
            }else{
              dp[i][0] += 1;
              dp[i][0] %= mod;
            }
          }
          if(i < n-1 && in_range(b-1,10)){
            if(i == 0 && b == 1) continue;
            dp[i][0] += dp[i+1][1];
            dp[i][0] %= mod;
          }
          if(in_range(b_,10)){
            if(i < n-1){
              dp[i][1] += dp[i+1][0];
              dp[i][1] %= mod;
            }else{
              ++dp[i][1];
              dp[i][1] %= mod;
            }
          }
          if(i < n-1 && in_range(b_-1,10)){
            if(i == 0 && b_ == 1) continue;
            dp[i][1] += dp[i+1][1];
            dp[i][1] %= mod;
          }
        }else if(B[i] != '?'){//A[i] == '?'
          int b = B[i] - '0', a = c - b, a_ = c - b + 10;
          if(i == 0 && (a == 0 || b == 0)) continue;
          if(in_range(a,10)){
            if(i < n-1){
              dp[i][0] += dp[i+1][0];
              dp[i][0] %= mod;
            }else{
              ++dp[i][0];
              dp[i][0] %= mod;
            }
          }
          if(i < n-1 && in_range(a-1,10)){
            if(i == 0 && a == 1) continue;
            dp[i][0] += dp[i+1][1];
            dp[i][0] %= mod;
          }
          if(in_range(a_,10)){
            if(i < n-1){
              dp[i][1] += dp[i+1][0];
              dp[i][1] %= mod;
            }else{
              ++dp[i][1];
              dp[i][1] %= mod;
            }
          }
          if(i < n-1 && in_range(a_-1,10)){
            if(i == 0 && a_ == 1) continue;
            dp[i][1] += dp[i+1][1];
            dp[i][1] %= mod;
          }
        }else{//A[i] == B[i] == '?'
          for(int a = 0; a < 10; ++a){
            for(int b = 0; b < 10; ++b){
              if(i == 0 && (a == 0 || b == 0)) continue;//leading zero
              if(a + b == c){
                if(i < n-1){
                  dp[i][0] += dp[i+1][0];
                  dp[i][0] %= mod;
                }else{
                  ++dp[i][0];
                  dp[i][0] %= mod;
                }
              }
              if(i < n-1 && a + b + 1 == c){
                dp[i][0] += dp[i+1][1];
                dp[i][0] %= mod;
              }
              if(a + b == c + 10){
                if(i < n-1){
                  dp[i][1] += dp[i+1][0];
                  dp[i][1] %= mod;
                }else{
                  ++dp[i][1];
                  dp[i][1] %= mod;
                }
              }
              if(i < n-1 && a + b + 1 == c + 10){
                dp[i][1] += dp[i+1][1];
                dp[i][1] %= mod;
              }
            }
          }
        }
      }else{//C[i] == '?'
        for(int c = 0; c < 10; ++c){
          if(i == 0 && c == 0) continue;
          if(A[i] != '?' && B[i] != '?'){
            int a = A[i] - '0', b = B[i] - '0';
            if(i == 0 && (a == 0 || b == 0)) continue;
            if(a + b == c){
              if(i < n-1){
                dp[i][0] += dp[i+1][0];
                dp[i][0] %= mod;
              }else{
                ++dp[i][0];
                dp[i][0] %= mod;
              }
            }
            if(i < n-1 && a + b + 1 == c){
              dp[i][0] += dp[i+1][1];
              dp[i][0] %= mod;
            }
            if(a + b == 10 + c){
              if(i < n-1){
                dp[i][1] += dp[i+1][0];
                dp[i][1] %= mod;
              }else{
                ++dp[i][1];
                dp[i][1] %= mod;
              }
            }
            if(i < n-1 && a + b + 1 == 10 + c){
              dp[i][1] += dp[i+1][1];
              dp[i][1] %= mod;
            }
          }else if(A[i] != '?'){//B[i] == '?'
            int a = A[i] - '0', b = c - a, b_ = c - a + 10;
            if(i == 0 && (a == 0 || b == 0)) continue;
            if(in_range(b,10)){
              if(i < n-1){
                dp[i][0] += dp[i+1][0];
                dp[i][0] %= mod;
              }else{
                dp[i][0] += 1;
                dp[i][0] %= mod;
              }
            }
            if(i < n-1 && in_range(b-1,10)){
              if(i == 0 && b == 1) continue;
              dp[i][0] += dp[i+1][1];
              dp[i][0] %= mod;
            }
            if(in_range(b_,10)){
              if(i < n-1){
                dp[i][1] += dp[i+1][0];
                dp[i][1] %= mod;
              }else{
                ++dp[i][1];
                dp[i][1] %= mod;
              }
            }
            if(i < n-1 && in_range(b_-1,10)){
              if(i == 0 && b_ == 1) continue;
              dp[i][1] += dp[i+1][1];
              dp[i][1] %= mod;
            }
          }else if(B[i] != '?'){//A[i] == '?'
            int b = B[i] - '0', a = c - b, a_ = c - b + 10;
            if(i == 0 && (a == 0 || b == 0)) continue;
            if(in_range(a,10)){
              if(i < n-1){
                dp[i][0] += dp[i+1][0];
                dp[i][0] %= mod;
              }else{
                ++dp[i][0];
                dp[i][0] %= mod;
              }
            }
            if(i < n-1 && in_range(a-1,10)){
              if(i == 0 && a == 1) continue;
              dp[i][0] += dp[i+1][1];
              dp[i][0] %= mod;
            }
            if(in_range(a_,10)){
              if(i < n-1){
                dp[i][1] += dp[i+1][0];
                dp[i][1] %= mod;
              }else{
                ++dp[i][1];
                dp[i][1] %= mod;
              }
            }
            if(i < n-1 && in_range(a_-1,10)){
              if(i == 0 && a_ == 1) continue;
              dp[i][1] += dp[i+1][1];
              dp[i][1] %= mod;
            }
          }else{//A[i] == B[i] == '?'
            for(int a = 0; a < 10; ++a){
              for(int b = 0; b < 10; ++b){
                if(i == 0 && (a == 0 || b == 0)) continue;//leading zero
                if(a + b == c){
                  if(i < n-1){
                    dp[i][0] += dp[i+1][0];
                    dp[i][0] %= mod;
                  }else{
                    ++dp[i][0];
                    dp[i][0] %= mod;
                  }
                }
                if(i < n-1 && a + b + 1 == c){
                  dp[i][0] += dp[i+1][1];
                  dp[i][0] %= mod;
                }
                if(a + b == c + 10){
                  if(i < n-1){
                    dp[i][1] += dp[i+1][0];
                    dp[i][1] %= mod;
                  }else{
                    ++dp[i][1];
                    dp[i][1] %= mod;
                  }
                }
                if(i < n-1 && a + b + 1 == c + 10){
                  dp[i][1] += dp[i+1][1];
                  dp[i][1] %= mod;
                }
              }
            }
          } 
        }
      }
    }
    //for(int i = 0; i < n; ++i) cout << dp[i][0] << " ";cout << endl;
    //for(int i = 0; i < n; ++i) cout << dp[i][1] << " ";cout << endl;

    cout << dp[0][0] << endl;
  }
  return 0;
}



Measured memory_bytes: 3032