#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string.h>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000001
using namespace std;

int main(){

	ll dp_nashi[12][12][12];
	ll dp_ari[12][12][12];


	for(int i = 0; i <= 11; i++){
		for(int k = 0; k <= 11; k++){
			for(int p = 0; p <= 11; p++){
				dp_nashi[i][k][p] = 0;
				dp_ari[i][k][p] = 0;
			}
		}
	}

	for(int first = 0; first <= 9; first++){
		for(int second = 0; second <= 9; second++){
			for(int third = 0; third <= 9; third++){

				if(first+second == third){
					dp_nashi[first][second][third]++;
				}else if(first+second == 10+third){
					dp_ari[first][second][third]++;
				}
			}
		}
	}


	for(int a = 0; a <= 9; a++){
		for(int b = 0; b <= 9; b++){
			for(int c = 0; c <= 9; c++){

				dp_nashi[a][b][10] += dp_nashi[a][b][c];
				dp_ari[a][b][10] += dp_ari[a][b][c];

				dp_nashi[a][10][b] += dp_nashi[a][c][b];
				dp_ari[a][10][b] += dp_ari[a][c][b];

				dp_nashi[10][a][b] += dp_nashi[c][a][b];
				dp_ari[10][a][b] += dp_ari[c][a][b];

				dp_nashi[10][10][c] += dp_nashi[a][b][c];
				dp_ari[10][10][c] += dp_ari[a][b][c];

				dp_nashi[10][c][10] += dp_nashi[a][c][b];
				dp_ari[10][c][10] += dp_ari[a][c][b];

				dp_nashi[c][10][10] += dp_nashi[c][a][b];
				dp_ari[c][10][10] += dp_ari[c][a][b];

				dp_nashi[10][10][10] += dp_nashi[a][b][c];
				dp_ari[10][10][10] += dp_ari[a][b][c];
			}
		}
	}



	for(int a = 1; a <= 8; a++){
		for(int b = 1; b <= 8; b++){
			if(a + b >= 10)continue;
			for(int c = 2; c <= 9; c++){
				if(a+b == c){
					dp_nashi[11][11][11] += dp_nashi[a][b][c];
				}
			}
		}
	}


	for(int a = 1; a <= 9; a++){
		for(int b = 1; b <= 9; b++){
			for(int c = 0; c <= 9; c++){

				dp_nashi[11][11][c] += dp_nashi[a][b][c];
				dp_ari[11][11][c] += dp_ari[a][b][c];

				dp_nashi[11][c][11] += dp_nashi[a][c][b];
				dp_ari[11][c][11] += dp_ari[a][c][b];

				dp_nashi[c][11][11] += dp_nashi[c][a][b];
				dp_ari[c][11][11] += dp_ari[c][a][b];
			}
		}
	}


	for(int a = 1; a <= 9; a++){
		for(int b = 0; b <= 9; b++){
			for(int c = 0; c <= 9; c++){

				dp_nashi[11][b][c] += dp_nashi[a][b][c];
				dp_ari[11][b][c] += dp_ari[a][b][c];

				dp_nashi[b][11][c] += dp_nashi[b][a][c];
				dp_ari[b][11][c] += dp_ari[b][a][c];

				dp_nashi[b][c][11] += dp_nashi[b][c][a];
				dp_ari[b][c][11] += dp_ari[b][c][a];
			}
		}
	}

	char first[51],second[51],third[51];
	ll ans;
	ll first_length,second_length,third_length,limit;

	while(true){
		scanf("%s",first);
		if(first[0] == '0')break;

		scanf("%s",second);
		scanf("%s",third);

		for(first_length = 0; first[first_length] != '\0';first_length++);
		for(second_length = 0;second[second_length] != '\0';second_length++);
		for(third_length = 0;third[third_length] != '\0';third_length++);

		if(third_length - max(first_length,second_length) > 1 || (third_length-max(first_length,second_length) == 1 && third[0] >= '2' && third[0] <= '9') ||
				max(first_length,second_length) > third_length){
			printf("0\n");
			continue;
		}

		ans = 1;

		limit = third_length-1;

		ll first_num,second_num,third_num,nashi_num,ari_num,pre_nashi_num = 1,pre_ari_num = 0;
		ll check_first,check_second,check_third;

		bool isKuriagariOK;

		for(int digit = 0; digit <= limit; digit++){

			if(digit <= first_length-1){
				if(first[(first_length-1)-digit] != '?'){
					first_num = first[(first_length-1)-digit]-'0';
				}else{
					if(digit < first_length-1){
						first_num = 10;
					}else{
						first_num = 11;
					}
				}
			}else{
				first_num = 0;
			}

			if(digit <= second_length-1){
				if(second[(second_length-1)-digit] != '?'){
					second_num = second[(second_length-1)-digit]-'0';
				}else{
					if(digit < second_length-1){
						second_num = 10;
					}else{
						second_num = 11;
					}
				}
			}else{
				second_num = 0;
			}

			if(third[(third_length-1)-digit] != '?'){
				third_num = third[(third_length-1)-digit] - '0';
			}else{
				if(digit < third_length-1){
					third_num = 10;
				}else{
					third_num = 11;
				}
			}

			if(digit == third_length-1){
				isKuriagariOK = false;
			}else{
				isKuriagariOK = true;
			}
			for(int tmp = digit+1; tmp <= (third_length-1);tmp++){

				if(tmp <= first_length-1){
					if(first[(first_length-1)-tmp] != '?'){
						check_first = first[(first_length-1)-tmp]-'0';
					}else{
						if(tmp < first_length-1){
							check_first = 10;
						}else{
							check_first = 11;
						}
					}
				}else{
					check_first = 0;
				}

				if(tmp <= second_length-1){
					if(second[(second_length-1)-tmp] != '?'){
						check_second = second[(second_length-1)-tmp]-'0';
					}else{
						if(tmp < second_length-1){
							check_second = 10;
						}else{
							check_second = 11;
						}
					}
				}else{
					check_second = 0;
				}

				if(tmp <= third_length-1){
					if(third[(third_length-1)-tmp] != '?'){
						check_third = third[(third_length-1)-tmp]-'0';
					}else{
						if(tmp < third_length-1){
							check_third = 10;
						}else{
							check_third = 11;
						}
					}
				}else{
					check_third = 0;
				}

				if(check_first >= 10 && check_second >= 10 && check_third >= 10){
					break;
				}else if(check_first >= 10 && check_second >= 10 && check_third <= 9){ //??X

					if(third != 0){
						break;
					}else{
						if(tmp == third_length-1){
							isKuriagariOK = false;
							break;
						}
					}

				}else if(check_first >= 10 && check_second <= 9 && check_third >= 10){ //?X?

					if(check_second != 9){
						break;
					}else{
						if(tmp == third_length-1){
							isKuriagariOK = false;
							break;
						}
					}

				}else if(check_first <= 9 && check_second >= 10 && check_third >= 10){ //X??

					if(check_first != 9){
						break;
					}else{
						if(tmp == third_length-1){
							isKuriagariOK = false;
							break;
						}
					}

				}else if(check_first >= 10 && check_second <= 9 && check_third <= 9){ //?XX

					if(check_second+1 <= check_third){
						break;
					}else{
						if(tmp == third_length-1){
							isKuriagariOK = false;
							break;
						}
					}

				}else if(check_first <= 9 && check_second >= 10 && check_third <= 9){ //X?X
					if(check_first+1 <= check_third){
						break;
					}else{
						if(tmp == third_length-1){
							isKuriagariOK = false;
							break;
						}
					}


				}else if(check_first <= 9 && check_second <= 9 && check_third >= 10){ //XX?

					if(check_first+check_second+1 <= 9){
						break;
					}else{
						if(tmp == third_length-1){
							isKuriagariOK = false;
							break;
						}
					}

				}else{ //first <= 9 && second <= 9 && third <= 9
					if(check_first+check_second+1 <= check_third){
						break;
					}else{
						if(tmp == third_length-1){
							isKuriagariOK = false;
							break;
						}
					}
				}
			}


			ari_num = 0;
			nashi_num = 0;

			if(pre_nashi_num == 0){
				if(first_num <= 8){
					nashi_num += pre_ari_num*dp_nashi[first_num+1][second_num][third_num]%MOD;
					nashi_num = (nashi_num+MOD)%MOD;
				}else if(first_num == 9){
					if(isKuriagariOK){
						ari_num += pre_ari_num*dp_nashi[0][second_num][third_num]%MOD;
						ari_num = (ari_num+MOD)%MOD;
					}
				}else if(first_num == 10){ //first >= 10

					for(ll a = 1; a <= 9; a++){
						nashi_num += pre_ari_num*dp_nashi[a][second_num][third_num]%MOD;
						nashi_num = (nashi_num+MOD)%MOD;
					}
					if(isKuriagariOK){
						ari_num += pre_ari_num*dp_nashi[0][second_num][third_num]%MOD;
						ari_num = (ari_num+MOD)%MOD;
					}
				}else{ //first == 11

					for(ll a = 2; a <= 9; a++){
						nashi_num += pre_ari_num*dp_nashi[a][second_num][third_num]%MOD;
						nashi_num = (nashi_num+MOD)%MOD;
					}
					if(isKuriagariOK){
						ari_num += pre_ari_num*dp_nashi[0][second_num][third_num]%MOD;
						ari_num = (ari_num+MOD)%MOD;
					}
				}

				if(isKuriagariOK){
					if(first_num <= 8){
						ari_num += pre_ari_num*dp_ari[first_num+1][second_num][third_num]%MOD;
						ari_num = (ari_num+MOD)%MOD;
					}else if(first_num == 9){
						ari_num += pre_ari_num*dp_ari[0][second_num][third_num]%MOD;
						ari_num = (ari_num+MOD)%MOD;
					}else if(first_num == 10){ //first >= 10

						for(ll a = 1; a <= 9; a++){
							ari_num += pre_ari_num*dp_ari[a][second_num][third_num]%MOD;
							ari_num = (ari_num+MOD)%MOD;
						}
						ari_num += pre_ari_num*dp_ari[0][second_num][third_num]%MOD;
						ari_num = (ari_num+MOD)%MOD;
					}else{
						for(int a = 2; a <= 9; a++){
							ari_num += pre_ari_num*dp_ari[a][second_num][third_num]%MOD;
							ari_num = (ari_num+MOD)%MOD;
						}
						ari_num += pre_ari_num*dp_ari[0][second_num][third_num]%MOD;
						ari_num = (ari_num+MOD)%MOD;
					}
				}


			}else{ //pre_nashi_num > 0
				nashi_num += pre_nashi_num*dp_nashi[first_num][second_num][third_num]%MOD;
				nashi_num = (nashi_num+MOD)%MOD;
				if(pre_ari_num > 0){
					if(first_num <= 8){
						nashi_num += pre_ari_num*dp_nashi[first_num+1][second_num][third_num]%MOD;
						nashi_num = (nashi_num+MOD)%MOD;
					}else if(first_num == 9){
						if(isKuriagariOK){

							ari_num += pre_ari_num*dp_nashi[0][second_num][third_num]%MOD;
							ari_num = (ari_num+MOD)%MOD;
						}

					}else if(first_num == 10){ // first >= 10

						for(ll a = 1; a <= 9; a++){
							nashi_num += pre_ari_num*dp_nashi[a][second_num][third_num]%MOD;
							nashi_num = (nashi_num+MOD)%MOD;
						}
						if(isKuriagariOK){

							ari_num += pre_ari_num*dp_nashi[0][second_num][third_num]%MOD;
							ari_num = (ari_num+MOD)%MOD;
						}
					}else{ //first_num == 11

						for(ll a = 2; a <= 9; a++){
							nashi_num += pre_ari_num*dp_nashi[a][second_num][third_num]%MOD;
							nashi_num = (nashi_num+MOD)%MOD;
						}
						if(isKuriagariOK){
							ari_num += pre_ari_num*dp_nashi[0][second_num][third_num]%MOD;
							ari_num = (ari_num+MOD)%MOD;
						}
					}
				}

				if(isKuriagariOK){
					ari_num += pre_nashi_num*dp_ari[first_num][second_num][third_num]%MOD;
					ari_num = (ari_num+MOD)%MOD;
					if(pre_ari_num > 0){
						if(first_num <= 8){
							ari_num += pre_ari_num*dp_ari[first_num+1][second_num][third_num]%MOD;
						}else if(first_num == 9){

							ari_num += pre_ari_num*dp_ari[0][second_num][third_num]%MOD;
							ari_num = (ari_num+MOD)%MOD;
						}else if(first_num == 10){ // first >= 10

							for(ll a = 1; a <= 9; a++){
								ari_num += pre_ari_num*dp_ari[a][second_num][third_num]%MOD;
								ari_num = (ari_num+MOD)%MOD;
							}

							ari_num += pre_ari_num*dp_ari[0][second_num][third_num]%MOD;
							ari_num = (ari_num+MOD)%MOD;
						}else{
							for(ll a = 2; a <= 9; a++){
								ari_num += pre_ari_num*dp_ari[a][second_num][third_num]%MOD;
								ari_num = (ari_num+MOD)%MOD;
							}

							ari_num += pre_ari_num*dp_ari[0][second_num][third_num]%MOD;
							ari_num = (ari_num+MOD)%MOD;

						}
					}
				}
			}

			if(nashi_num == 0 && ari_num == 0){
				ans = 0;
				break;
			}

			ans = (nashi_num+ari_num)%MOD;

			pre_nashi_num = nashi_num%MOD;
			pre_ari_num = ari_num%MOD;
		}


		printf("%lld\n",ans%MOD);
	}

	return 0;
}

Measured memory_bytes: 2608