#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr long long MOD = 1000000007LL;


template <uint_fast64_t Modulus>
struct ModInt {
    using u64 = uint_fast64_t;
    u64 val;
    constexpr ModInt(const int x = 0) noexcept : val(x >= 0 ? x%Modulus : x%(int)Modulus+Modulus){}
    constexpr const u64& value() const noexcept { return val; }
    constexpr ModInt operator-() const noexcept { return val ? Modulus-val : 0; }
    constexpr ModInt operator+(const ModInt& rhs) const noexcept { return ModInt(*this) += rhs; }
    constexpr ModInt operator-(const ModInt& rhs) const noexcept { return ModInt(*this) -= rhs; }
    constexpr ModInt operator*(const ModInt& rhs) const noexcept { return ModInt(*this) *= rhs; }
    constexpr ModInt operator/(const ModInt& rhs) const noexcept { return ModInt(*this) /= rhs; }
    constexpr bool operator==(const ModInt& rhs) const noexcept { return val == rhs.val; }
    constexpr bool operator!=(const ModInt& rhs) const noexcept { return val != rhs.val; }
    constexpr ModInt& operator+=(const ModInt& rhs) noexcept {
        val += rhs.val;
        if(val >= Modulus) val -= Modulus;
        return *this;
    }
    constexpr ModInt& operator-=(const ModInt& rhs) noexcept {
        if(val < rhs.val) val += Modulus;
        val -= rhs.val;
        return *this;
    }
    constexpr ModInt& operator*=(const ModInt& rhs) noexcept {
        val = val*rhs.val%Modulus;
        return *this;
    }
    constexpr ModInt& operator/=(const ModInt& rhs) noexcept {
        *this *= rhs.inverse();
        return *this;
    }
    constexpr ModInt inverse() const noexcept {
        int a = val, b = Modulus, u = 1, v = 0;
        while(b){
            int t = a/b;
            a -= t*b; swap(a, b);
            u -= t*v; swap(u, v);
        }
        return ModInt(u);
    }
    constexpr ModInt pow(u64 n) const noexcept {
        ModInt res(1), mul(val);
        while(n > 0){
            if(n&1) res *= mul;
            mul *= mul;
            n >>= 1;
        }
        return res;
    }
    friend constexpr ModInt operator+(const int lhs, const ModInt& rhs) noexcept { return rhs+lhs; }
    friend constexpr ModInt operator*(const int lhs, const ModInt& rhs) noexcept { return rhs*lhs; }
    friend ostream& operator<<(ostream& os, const ModInt& rhs){ return os << rhs.val; }
    friend istream& operator>>(istream& is, ModInt& rhs){
        u64 t;
        is >> t;
        rhs = ModInt<Modulus>(t);
        return is;
    }
};
using modint = ModInt<MOD>;


string A, B, C;
modint mem[60][2];


bool jdg(int x, int y, int z, int k){
    int a = A[k]-'0';
    int b = B[k]-'0';
    int c = C[k]-'0';
    if(A[k] == '?') a = x;
    if(B[k] == '?') b = y;
    if(C[k] == '?') c = z;
    if(a != x) return false;
    if(b != y) return false;
    if(c != z) return false;
    return true;
}


modint rec(int k = 0, bool t = false){
    if(k == A.size()) return !t;
    modint& res = mem[k][t];
    if(res != -1) return res;
    res = 0;
    int x = (k == 0);
    for(int a = x;a < 10;++a) for(int b = x;b < 10;++b) for(int c = x;c < 10;++c) if(jdg(a, b, c, k)){
        int d = c;
        if(t) d += 10;
        if(a+b == d) res += rec(k+1, false);
        else if(a+b+1 == d) res += rec(k+1, true);
    }
    return res;
}


signed main(){
    while(cin >> A, A[0]-'0'){
        cin >> B >> C;
        for_each(mem, mem+60, [](auto& ary){ fill(ary, ary+2, -1); });
        cout << rec() << endl;
    }
}


Measured memory_bytes: 3148