#include <bits/stdc++.h>
using namespace std;

const int MOD = 1e9 + 7;

int n;
int a[64], b[64], c[64];
int dp[64][2];

void conv(string &s, int a[])
{
	for (int i = 0; i < n; i++){
		if (s[i] == '?') a[i] = -1;
		else a[i] = s[i] - '0';
	}
}

int calc(int d, int m)
{
	if (d == n) return !m;
	if (~dp[d][m]) return dp[d][m];
	
	int res = 0;
	
	for (int i = !d; i <= 9; i++){
		for (int j = !d; j <= 9; j++){
			for (int k = !d; k <= 9; k++){
				if ((~a[d]) && a[d] != i) continue;
				if ((~b[d]) && b[d] != j) continue;
				if ((~c[d]) && c[d] != k) continue;
				int kk = m * 10 + k;
				if (i + j != kk && i + j + 1 != kk) continue;
				int nm = kk - i - j;
				res = (res + calc(d + 1, nm)) % MOD;
			}
		}
	}
	
	return dp[d][m] = res;
}

int main()
{
	string sa, sb, sc;
	while (cin >> sa >> sb >> sc){
		n = sa.size();
		conv(sa, a);
		conv(sb, b);
		conv(sc, c);
		
		memset(dp, -1, sizeof(dp));
		printf("%d\n", calc(0, 0));
	}
}