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

constexpr int MOD = 1e9+7;

using ll = long long;

int main() {
    string A, B, C;
    while(cin >> A, A != "0") {
        cin >> B >> C;
        reverse(A.begin(), A.end());
        reverse(B.begin(), B.end());
        reverse(C.begin(), C.end());

        vector<vector<ll>> dp(2, vector<ll>(A.size()+1, 0));
        dp[0][0] = 1;
        for(int i=0; i<A.size(); ++i) {
            char a = A[i], b = B[i], c = C[i]; 
            int an = A[i]-'0', bn = B[i]-'0', cn = C[i]-'0';
            int check = 0;
            int l = (i == A.size()-1 ? 1 : 0);
            for(int j=0; j<2; ++j) {
                if(dp[j][i] == 0) {
                    continue;
                }
                if(a != '?' && b != '?') {
                    if(c != '?' && (a-'0' + b-'0' + j)%10 != c-'0') {
                        continue;
                    } else {
                        (dp[(an+bn+j)/10][i+1] += dp[j][i]) %= MOD;
                    }
                } else if(a != '?' || b != '?') {
                    int num = (a != '?' ? an : bn);
                    if(c != '?') {
                        for(int k=l; k<10; ++k) {
                            if(cn == (num + k + j)%10) {
                                (dp[(num+k+j)/10][i+1] += dp[j][i]) %= MOD;
                                break;
                            }
                        }
                    } else {
                        for(int k=l; k<10; ++k) {
                            (dp[(num+k+j)/10][i+1] += dp[j][i]) %= MOD;
                        }
                    }
                } else {
                    if(c != '?') {
                        for(int k=l; k<10; ++k) {
                            for(int m=l; m<10; ++m) {
                                if(cn == (k+m+j)%10) {
                                    (dp[(k+m+j)/10][i+1] += dp[j][i]) %= MOD;
                                }
                            }
                        }
                    } else {
                        for(int k=l; k<10; ++k) {
                            for(int m=l; m<10; ++m) {
                                (dp[(k+m+j)/10][i+1] += dp[j][i]) %= MOD;
                            }
                        }
                    }
                }
            }
        }
        cout << dp[0][A.size()] << endl;
    }
}
