#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll MOD = (ll)1e9 + 7;

string A, B, C;

int main() {
	while(cin >> A, A != "0") {
		cin >> B >> C;

		reverse(A.begin(), A.end());
		reverse(B.begin(), B.end());
		reverse(C.begin(), C.end());

		int n = B.size();

		ll dp[55][2] = { 0 };

		dp[0][0] = 1;
		for(int i = 0; i < n; i++) {
			for(int j = 0; j < 2; j++) {
				int q = 0, s = 0, t = 0;
				if(A[i] == '?') q++;
				else s += A[i] - '0';
				if(B[i] == '?') q++;
				else s += B[i] - '0';
				if(C[i] != '0') t = C[i] - '0';

				if(q == 2) {
					for(int a = 0; a <= 9; a++) {
						if(i == n - 1 && a == 0) continue;
						for(int b = 0; b <= 9; b++) {
							if(i == n - 1 && b == 0) continue;
							if(i == n - 1 && (t == 0 || (a + b + j) % 10 == 0)) continue;
							if((C[i] == '?' || (a + b + j) % 10 == t)) {
								int nj = a + b + j >= 10;
								(dp[i + 1][nj] += dp[i][j]) %= MOD;
							}
						}
					}
				}
				else if(q == 1) {
					for(int a = 0; a <= 9; a++) {
						if(i == n - 1 && a == 0) continue;
						if((i == n - 1 && (s + a + j) % 10 == 0)) continue;
						if(C[i] == '?' || (s + a + j) % 10 == t) {
							if(s + a + j >= 10) {
								(dp[i + 1][1] += dp[i][j]) %= MOD;
							}
							else {
								(dp[i + 1][0] += dp[i][j]) %= MOD;
							}
						}
					}
				}
				else { // q == 0
					if((i == n - 1 && (s + j) % 10 == 0)) continue;
					if(C[i] == '?' || (s + j) % 10 == t) {
						if((s + j) >= 10) {
							(dp[i + 1][1] += dp[i][j]) %= MOD;
						}
						else {
							(dp[i + 1][0] += dp[i][j]) %= MOD;
						}
					}
				}
			}// for j
		}// for i
		cout << dp[n][0] << endl;
	}// while
}// main