#include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;




const int mod = 1000000007;
struct Mod {
public:
	int num;
	Mod() : num(0) { ; }
	Mod(long long int n) : num((n % mod + mod) % mod) { ; }
	Mod(int n) : num((n % mod + mod) % mod) { ; }
	operator int() { return num; }
};

Mod operator+(const Mod a, const Mod b) { return Mod((a.num + b.num) % mod); }
Mod operator+(const long long int a, const Mod b) { return Mod(a) + b; }
Mod operator++(Mod &a) { return a + Mod(1); }
Mod operator-(const Mod a, const Mod b) { return Mod((mod + a.num - b.num) % mod); }
Mod operator-(const long long int a, const Mod b) { return Mod(a) - b; }
Mod operator--(Mod &a) { return a - Mod(1); }
Mod operator*(const Mod a, const Mod b) { return Mod(((long long)a.num * b.num) % mod); }
Mod operator*(const long long int a, const Mod b) { return Mod(a)*b; }
Mod operator+=(Mod &a, const Mod b) { return a = a + b; }
Mod operator+=(long long int &a, const Mod b) { return a = a + b; }
Mod operator-=(Mod &a, const Mod b) { return a = a - b; }
Mod operator-=(long long int &a, const Mod b) { return a = a - b; }
Mod operator*=(Mod &a, const Mod b) { return a = a * b; }
Mod operator*=(long long int &a, const Mod b) { return a = a * b; }
Mod operator^(const Mod a, const int n) {
	if (n == 0) return Mod(1);
	Mod res = (a * a) ^ (n / 2);
	if (n % 2) res = res * a;
	return res;
}
Mod mod_pow(const Mod a, const int n) {
	if (n == 0) return Mod(1);
	Mod res = mod_pow((a * a), (n / 2));
	if (n % 2) res = res * a;
	return res;
}
Mod inv(const Mod a) { return a ^ (mod - 2); }
Mod operator/(const Mod a, const Mod b) {
	assert(b.num != 0);
	return a * inv(b);
}
Mod operator/(const long long int a, const Mod b) {
	assert(b.num != 0);
	return Mod(a) * inv(b);
}
Mod operator/=(Mod &a, const Mod b) {
	assert(b.num != 0);
	return a = a * inv(b);
}

#define MAX_MOD_N 1024000

Mod fact[MAX_MOD_N], factinv[MAX_MOD_N];
void init() {
	fact[0] = Mod(1); factinv[0] = 1;
	for (int i = 0; i < MAX_MOD_N - 1; ++i) {
		fact[i + 1] = fact[i] * Mod(i + 1);
		factinv[i + 1] = factinv[i] / Mod(i + 1);
	}
}
Mod comb(const int a, const int b) {
	return fact[a] * factinv[b] * factinv[a - b];
}

int main() {
	while (1) {
		string st[3]; cin >> st[0];
		if (st[0] == "0")break;
		cin>> st[1] >> st[2];
		Mod dp[51][10];
		dp[st[0].size()-1][0] = 1;
		for (int i = st[0].size()-1; i > 0; --i) {
			char a, b, c; a = st[0][i];
			b = st[1][i]; c = st[2][i];
			int al, ar, bl, br, cl, cr;
			if (a == '?') {
				al = 0; ar = 9;
			}
			else {
				al = a - '0';
				ar = a - '0';
			}
			if (b == '?') {
				bl = 0; br = 9;
			}
			else {
				bl = b - '0';
				br = b - '0';
			}
			if (c == '?') {
				cl = 0; cr = 9;
			}
			else {
				cl = c - '0';
				cr = c - '0';
			}
			for (int j = 0; j < 10; ++j) {
				for (int x = al; x <= ar; ++x) {
					for (int y = bl; y <= br; ++y) {
						for (int z = cl; z <= cr; ++z) {
							if ((j + x + y) % 10==z) {
								int amari = (x + y + j) / 10;
								dp[i-1][amari] += dp[i][j];
							}
						}
					}
				}
			}
		}
		Mod ans = 0;
		{
			char a, b, c; a = st[0][0];
			b = st[1][0]; c = st[2][0];
			int al, ar, bl, br, cl, cr;
			if (a == '?') {
				al = 1; ar = 9;
			}
			else {
				al = a - '0';
				ar = a - '0';
			}
			if (b == '?') {
				bl = 1; br = 9;
			}
			else {
				bl = b - '0';
				br = b - '0';
			}
			if (c == '?') {
				cl = 1; cr = 9;
			}
			else {
				cl = c - '0';
				cr = c - '0';
			}
			for (int j = 0; j < 10; ++j) {
				for (int x = al; x <= ar; ++x) {
					for (int y = bl; y <= br; ++y) {
						for (int z = cl; z <= cr; ++z) {
							if ((j + x + y) % 10 == z) {
								int amari = (x + y + j) / 10;
if(!amari)								ans += dp[0][j];
							}
						}
					}
				}
			}

		}
		cout << ans << endl;


	}
	return 0;
}

Measured memory_bytes: 11120