#include<bits/stdc++.h>
using namespace std;

using ll=long long;
const ll MOD=1e9+7;
ll solve(int n,vector<int> a,vector<int> b,vector<int> c){
    vector<vector<int>> dp(n+1,vector<int>(2,0));
    dp[0][0]=1;
    for(int i=0;i<n;i++){
        int lb=(i==0 ? 1 : 0);
        for(int an=lb;an<10;an++){
            if(a[i]!=-1 && an!=a[i]) continue;
            for(int bn=lb;bn<10;bn++){
                if(b[i]!=-1 && bn!=b[i]) continue;
                //cerr<<"#"<<i<<" "<<an<<" "<<bn<<endl;
                int digit=(an+bn)%10;
                int carry=(an+bn)/10;
                if(c[i]==-1 || digit==c[i]){
                    dp[i+1][0]+=dp[i][carry];
                    dp[i+1][0]%=MOD;
                }
                digit=(an+bn+1)%10;
                carry=(an+bn+1)/10;
                if(c[i]==-1 || digit==c[i]){
                    dp[i+1][1]+=dp[i][carry];
                    dp[i+1][1]%=MOD;
                }
            }
        }
    }
    return dp[n][0]%MOD;
}

int tonum(char x){
    if(isdigit(x)) return x-'0';
    else return -1;
}
int main(){
    string abuf,bbuf,cbuf;
    
    while(cin>>abuf>>bbuf>>cbuf,abuf!="0"){
        int n=abuf.size();
        vector<int> a(n),b(n),c(n);
        for(int i=0;i<n;i++){
            a[i]=tonum(abuf[i]);
            b[i]=tonum(bbuf[i]);
            c[i]=tonum(cbuf[i]);
        }
        cout<<solve(n,a,b,c)<<endl;
    }
    return 0;
}
