#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
#define mod 1000000007
string A, B, C; long long dp[70][3];
int main() {
	while (true) {
		cin >> A; if (A == "0")break;
		cin >> B >> C;
		for (int i = 0; i < 210; i++)dp[i / 3][i % 3] = 0;
		reverse(A.begin(), A.end()); int A1 = A.size();
		reverse(B.begin(), B.end()); int B1 = B.size();
		reverse(C.begin(), C.end()); int C1 = C.size();
		while (A.size() < 60)A = A + '0';
		while (B.size() < 60)B = B + '0';
		while (C.size() < 60)C = C + '0';
		dp[0][0] = 1;
		for (int i = 0; i < 60; i++) {
			for (int j = 0; j < 3; j++) {
				int a = 0, b = 0, c = 0;
				for (int k = 0; k < 10; k++) {
					for (int l = 0; l < 10; l++) {
						int m = j + k + l;
						if ((k != (int)(A[i] - '0') && A[i] != '?') || (i == A1 - 1 && k == 0))continue;
						if ((l != (int)(B[i] - '0') && B[i] != '?') || (i == B1 - 1 && l == 0))continue;
						if ((m % 10 != (int)(C[i] - '0') && C[i] != '?') || (i == C1 - 1 && m % 10 == 0))continue;
						if (m >= 0 && m < 10)a++;
						if (m >= 10 && m < 20)b++;
						if (m >= 20 && m < 30)c++;
					}
				}
				dp[i + 1][0] += dp[i][j] * a; dp[i + 1][0] %= mod;
				dp[i + 1][1] += dp[i][j] * b; dp[i + 1][1] %= mod;
				dp[i + 1][2] += dp[i][j] * c; dp[i + 1][2] %= mod;
			}
		}
		cout << (dp[60][0] + dp[60][1] + dp[60][2]) % mod << endl;
	}
	return 0;
}