#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
#define REP(i, x, y) for(ll i = x; i < y; i++)
#define PER(i, x, y) for(ll i = x; i > y; i--)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-11;

ll multiply(ll x, ll y) {
    return (x % mod) * (y % mod) % mod;
}

ll dp[60][2];

int main() {
    while (1) {
        string A, B, C;
        cin >> A;
        if (A == "0") {
            break;
        }
        cin >> B >> C;
        ll len = A.size();
        REP(i, 0, 60) {
            fill(dp[i], dp[i] + 2, 0);
        }
        dp[0][0] = 1;
        dp[0][1] = 0;
        REP(i, 0, len) {
            ll rem = len - 1 - i;
            //cout << A[rem] << " " << B[rem] << " " << C[rem] << endl;
            if (C[rem] == '?') {
                if (A[rem] == '?') {
                    if (B[rem] == '?') {
                        if (rem != 0) {
                            dp[i + 1][0] += multiply(dp[i][0], 55) + multiply(dp[i][1], 45);
                            dp[i + 1][1] += multiply(dp[i][0], 45) + multiply(dp[i][1], 55);
                        } else {
                            dp[i + 1][0] += multiply(dp[i][0], 36) + multiply(dp[i][1], 28);
                            dp[i + 1][1] += multiply(dp[i][0], 45) + multiply(dp[i][1], 63);
                        }
                    } else {
                        ll b = B[rem] - '0';
                        if (rem != 0) {
                            if (b <= 8) {
                                dp[i + 1][0] += dp[i][0] + dp[i][1];
                            } else {
                                dp[i + 1][0] += dp[i][0];
                                dp[i + 1][1] += dp[i][1];
                            }
                        }
                        REP(j, 1, 10) {
                            if (b + j <= 8) {
                                dp[i + 1][0] += dp[i][0] + dp[i][1];
                            } else if (b + j == 9) {
                                dp[i + 1][0] += dp[i][0];
                                dp[i + 1][1] += dp[i][1];
                            } else {
                                dp[i + 1][1] += dp[i][0] + dp[i][1];
                            }
                        }
                    }
                } else {
                    ll a = A[rem] - '0';
                    if (B[rem] == '?') {
                        if (rem != 0) {
                            if (a <= 8) {
                                dp[i + 1][0] += dp[i][0] + dp[i][1];
                            } else {
                                dp[i + 1][0] += dp[i][0];
                                dp[i + 1][1] += dp[i][1];
                            }
                        }
                        REP(j, 1, 10) {
                            if (a + j <= 8) {
                                dp[i + 1][0] += dp[i][0] + dp[i][1];
                            } else if (a + j == 9) {
                                dp[i + 1][0] += dp[i][0];
                                dp[i + 1][1] += dp[i][1];
                            } else {
                                dp[i + 1][1] += dp[i][0] + dp[i][1];
                            }
                        }
                    } else {
                        ll b = B[rem] - '0';
                        if (a + b <= 8) {
                            dp[i + 1][0] += dp[i][0] + dp[i][1];
                        } else if (a + b == 9) {
                            dp[i + 1][0] += dp[i][0];
                            dp[i + 1][1] += dp[i][1];
                        } else {
                            dp[i + 1][1] += dp[i][0] + dp[i][1];
                        }
                    }
                }
            } else {
                ll c = C[rem] - '0';
                if (A[rem] == '?') {
                    if (B[rem] == '?') {
                        if (rem != 0) {
                            dp[i + 1][0] += multiply(dp[i][0], c + 1) + multiply(dp[i][1], c);
                        } else {
                            if (c >= 2) {
                                dp[i + 1][0] += multiply(dp[i][0], c - 1) + multiply(dp[i][1], c - 2);
                            }
                        }
                        ll tmp = 9 - c;
                        ll tmpb = 9 - (c - 1);
                        dp[i + 1][1] += multiply(dp[i][0], tmp) + multiply(dp[i][1], tmpb);
                    } else {
                        ll b = B[rem] - '0';
                        if (rem != 0) {
                            if (0 <= c - b) {
                                dp[i + 1][0] += dp[i][0];
                            }
                            if (0 <= c - 1 - b) {
                                dp[i + 1][0] += dp[i][1];
                            }
                        } else {
                            if (0 < c - b) {
                                dp[i + 1][0] += dp[i][0];
                            }
                            if (0 < c - 1 - b) {
                                dp[i + 1][0] += dp[i][1];
                            }
                        }
                        if (10 + c - b <= 9) {
                            dp[i + 1][1] += dp[i][0];
                        }
                        if (10 + c - 1 - b <= 9) {
                            dp[i + 1][1] += dp[i][1];
                        }
                    }
                } else {
                    ll a = A[rem] - '0';
                    if (B[rem] == '?') {
                        if (rem != 0) {
                            if (0 <= c - a) {
                                dp[i + 1][0] += dp[i][0];
                            }
                            if (0 <= c - 1 - a) {
                                dp[i + 1][0] += dp[i][1];
                            }
                        } else {
                            if (0 < c - a) {
                                dp[i + 1][0] += dp[i][0];
                            }
                            if (0 < c - 1 - a) {
                                dp[i + 1][0] += dp[i][1];
                            }
                        }
                        if (10 + c - a <= 9) {
                            dp[i + 1][1] += dp[i][0];
                        }
                        if (10 + c - 1 - a <= 9) {
                            dp[i + 1][1] += dp[i][1];
                        }
                    } else {
                        ll b = B[rem] - '0';
                        if (a + b == c) {
                            dp[i + 1][0] += dp[i][0];
                        }
                        if (a + b == c - 1) {
                            dp[i + 1][0] += dp[i][1];
                        }
                        if (a + b == c + 10) {
                            dp[i + 1][1] += dp[i][0];
                        }
                        if (a + b == c - 1 + 10) {
                            dp[i + 1][1] += dp[i][1];
                        }
                    }
                }
            }
            dp[i + 1][0] = dp[i + 1][0] % mod;
            dp[i + 1][1] = dp[i + 1][1] % mod;
        }
        // REP(i, 0, len + 1) {
        //     cout << dp[i][0] << " ";
        // }
        // cout << endl;
        // REP(i, 0, len + 1) {
        //     cout << dp[i][1] << " ";
        // }
        // cout << endl;
        ll ans = dp[len][0];
        cout << ans << endl;
    }
}



Measured memory_bytes: 3044