#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <utility>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <algorithm>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
#define rep(i,n)	for(int i=0;i<n;i++)
#define srep(i,a,n)	for(int i=a;i<n;i++)
#define REP(i,n)	for(int i=0;i<=n;i++)
#define rrep(i,n)	for(int i=n-1;i>=0;i--)
#define all(a)	begin(a),end(a)
#define mp(a,b)	make_pair(a,b)
#define fst	first
#define scn second

const ll inf = (ll)1e18;
const ll mod = (ll)1e9 + 7;
const ld eps = 1e-9;

ll dp[100][2];

int main() {
	while (true) {
		string a;	cin >> a;
		if (a == "0")	break;
		string b, c;	cin >> b >> c;
		if (c.size() != max(c.size(), max(a.size(), b.size()))) {
			cout << 0 << endl;
			continue;
		}
		while (a.size() < c.size())	a = "0" + a;
		while (b.size() < c.size())	b = "0" + b;
		int n = c.size();
		rep(i, n)	dp[i][0] = dp[i][1] = 0;
		srep(i, 1, 10){
			if (a[0] != '?'&&i != a[0] - '0')	continue;
			srep(j, 1, 10){
				if (b[0] != '?'&&j != b[0] - '0')	continue;
				srep(k, 1, 10) {
					if (c[0] != '?'&&k != c[0] - '0')	continue;
					if (k == i + j) {
						dp[0][0]++;
					}
					else if (k == i + j + 1) {
						dp[0][1]++;
					}
				}
			}
		}
		srep(i, 1, n) {
			rep(x, 10) {
				if (a[i] != '?'&&x != a[i] - '0')	continue;
				rep(y, 10) {
					if (b[i] != '?'&&y != b[i] - '0')	continue;
					rep(z, 10) {
						if (c[i] != '?'&&z != c[i] - '0')	continue;
						if (z == (x + y) % 10) {
							dp[i][0] = (dp[i][0] + dp[i - 1][(x + y) / 10]) % mod;
						}
						if (z == (x + y + 1) % 10) {
							dp[i][1] = (dp[i][1] + dp[i - 1][(x + y + 1) / 10]) % mod;
						}
					}
				}
			}
		}
		cout << dp[n-1][0] << endl;
	}
	return 0;
}