#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
long long mod=1000000007;
char A[60];
char B[60];
char C[60];
long long dp[60][2];
int main(){
	while(1){
		scanf("%s",A);
		if(A[0]=='0')break;
		scanf("%s%s",B,C);
		for(int i=0;i<60;i++)dp[i][0]=dp[i][1]=0;
		int n=strlen(A);
		dp[n][0]=1;
		for(int i=n-1;i>=0;i--){
			int t11=0;
			int t12=0;
			int t21=0;
			int t22=0;
			for(int j=0;j<10;j++){
				if(i==0&&j==0)continue;
				if(A[i]!='?'&&j!=A[i]-'0')continue;
				for(int k=0;k<10;k++){
					if(i==0&&k==0)continue;
					if(B[i]!='?'&&k!=B[i]-'0')continue;
					if(C[i]!='?'&&(j+k)%10!=C[i]-'0')continue;
					if(j+k>=10)t12++;
					else t11++;
				}
			}
			for(int j=0;j<10;j++){
				if(i==0&&j==0)continue;
				if(A[i]!='?'&&j!=A[i]-'0')continue;
				for(int k=0;k<10;k++){
					if(i==0&&k==0)continue;
					if(B[i]!='?'&&k!=B[i]-'0')continue;
					if(C[i]!='?'&&(j+k+1)%10!=C[i]-'0')continue;
					if(j+k+1>=10)t22++;
					else t21++;
				}
			}
			dp[i][0]=(dp[i+1][0]*t11+dp[i+1][1]*t21)%mod;
			dp[i][1]=(dp[i+1][0]*t12+dp[i+1][1]*t22)%mod;
		//	printf("%d: %lld %lld\n",i,dp[i][0],dp[i][1]);
		}
		printf("%lld\n",dp[0][0]);
	}
}