#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define MOD 1000000007ll
#define INF 1000000000ll
#define EPS 1e-10
#define FOR(i,n,m) for(ll i=n;i<(ll)m;i++)
#define REP(i,n) FOR(i,0,n)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end());
#define pb push_back

string a,b,c;
ll n;
ll memo[50][2];

ll dfs(ll pos, ll carry) {
	if(pos==n) {
		if(!carry) return 1;
		else return 0;
	}
	if(memo[pos][carry]!=-1) return memo[pos][carry];
	ll ret=0;
	REP(i,10) REP(j,10) REP(k,10) {
		if(a[pos]!='?'&&a[pos]-'0'!=i) continue;
		if(b[pos]!='?'&&b[pos]-'0'!=j) continue;
		if(c[pos]!='?'&&c[pos]-'0'!=k) continue;
		if(pos==0&&(i==0||j==0||k==0)) continue;
		ll g=k;
		if(carry) g+=10;
		if(i+j+1==g) ret+=dfs(pos+1,1);
		if(i+j==g) ret+=dfs(pos+1,0);
	}
	return memo[pos][carry]=ret%MOD;
}

ll solve() {
	n=(ll)a.size();
	REP(i,50) REP(j,2) memo[i][j]=-1;
	return dfs(0,0);
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	while(1) {
		cin>>a;
		if(a=="0") break;
		cin>>b>>c;
		cout<<solve()<<endl;
	}
}


