#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <functional>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define Fi first
#define Se second
#define INF (1<<29)
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

ll dp[128][2];
string A,B,C;

ll dfs(int n, int over){
  if(n<0){
    if(over) return 0;
    return 1;
  }
  ll &res = dp[n][over];
  if(res >= 0) return res;
  //  cout << n << " " << over << endl;
  res = 0;
  int a = A[n]-'0', b = B[n]-'0', c = C[n]-'0';
  if(A[n]!='?'&&B[n]!='?'&&C[n]!='?'){
    //    cout << n << " " << over << " " << A[n] << B[n] << C[n] << endl;
    if((a+b)%10==c && (a+b)/10 == over) res = (res+dfs(n-1, 0))%MOD;
    if((a+b+1)%10==c && (a+b+1)/10 == over) res = (res+dfs(n-1, 1))%MOD;
  }else if(A[n]!='?'&&B[n]!='?'){
    if((a+b)/10 == over) res = (res+dfs(n-1, 0))%MOD;
    if((a+b+1)/10 == over) res = (res+dfs(n-1, 1))%MOD;
  }else if(C[n]!='?'){
    if(A[n]!='?'||B[n]!='?'){
      if(b < 10) swap(a, b);
      for(int i=(n==A.size()-1?1:0);i<10;i++){
	//	cout << a << " " << i << " " << ((a+i)%10==c) << " " << over << endl;
	if((a+i)%10 == c && (a+i)/10 == over) res = (res+dfs(n-1, 0))%MOD;
	if((a+i+1)%10 == c && (a+i+1)/10 == over) res = (res+dfs(n-1, 1))%MOD;
      }
    }else{
      for(int i=(n==A.size()-1?1:0);i<10;i++) for(int j=(n==A.size()-1?1:0);j<10;j++){
	  if((i+j)%10 == c && (i+j)/10 == over) res = (res+dfs(n-1, 0))%MOD;
	  if((i+j+1)%10 == c && (i+j+1)/10 == over) res = (res+dfs(n-1, 1))%MOD;
	}
    }
  }else if(A[n]!='?'||B[n]!='?'){
    if(b<10) swap(a,b);
    for(int i=(n==A.size()-1?1:0);i<10;i++) for(int j=(n==A.size()-1?1:0);j<10;j++){
	//	cout << i << " " << j << " " << ((a+i)%10==j) << " " << ((a+i)/10==over) << endl;
	//	cout << i << " " << j << " " << ((a+i+1)%10==j) << " " << ((a+i)/10 == over) << endl;

	if((a+i)%10 == j && (a+i)/10 == over) res = (res+dfs(n-1, 0))%MOD;
	if((a+i+1)%10 == j && (a+i+1)/10 == over) res = (res+dfs(n-1, 1))%MOD;
	//	if(n==3&&(((a+i)%10 == j && (a+i)/10 == over) || ((a+i+1)%10 == j && (a+i+1)/10 == over)))
	//	  cout << n << " " << i << " " << j << " " << res << endl;
      }
  }else{
    for(int i=(n==A.size()-1?1:0);i<10;i++) for(int j=(n==A.size()-1?1:0);j<10;j++) for(int k=(n==A.size()-1?1:0);k<10;k++){
	  if((i+j)%10 == k && (i+j)/10 == over) res = (res+dfs(n-1, 0))%MOD;
	  if((i+j+1)%10 == k && (i+j+1)/10 == over) res = (res+dfs(n-1, 1))%MOD;
	  //	  if(n==32 && (((i+j)%10 == k && (i+j)/10 == over)) || (((i+j+1)%10 == k && (i+j+1)/10 == over)))
	  //	    cout << n << " " << i << " " << j << " " << k << " " << res << endl;
	}
  }

  return res;
}

int main(){
  while(cin >> A, A!="0"){
    cin >> B >> C;
    reverse(A.begin(), A.end());
    reverse(B.begin(), B.end());
    reverse(C.begin(), C.end());
    memset(dp, -1, sizeof(dp));
    cout << dfs(A.size()-1, 0)%MOD << endl;
  }
  return 0;
}