#include <cstdio>
#include <cstring>
#include <algorithm>

#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

const int mod = 1e9 + 7;

typedef long long ll;

int n;
char a[51];
char b[51];
char c[51];
int dp[51][2];

int add(int a, int b){
	return (a + b) % mod;
}

int main(){
	while(scanf("%s", a), scanf("%s%s", b, c) != EOF){
		n = strlen(a);
		rep(i, n + 1){
			fill_n(dp[i], 2, 0);
		}
		dp[0][0] = 1;
		for(int i = 1; i <= n; ++i){
			rep(s, 10){
				int p = a[n - i] == '?' ? s : a[n - i] - '0';
				rep(t, 10){
					int q = b[n - i] == '?' ? t : b[n - i] - '0';
					rep(u, 10){
						int r = c[n - i] == '?' ? u : c[n - i] - '0';
						if(i == n && (!p || !q || !r)){
							continue;
						}

						if((p + q) % 10 == r){
							dp[i][(p + q) / 10] = add(dp[i][(p + q) / 10], dp[i - 1][0]);
						}
						else if((p + q + 1) % 10 == r){
							dp[i][(p + q + 1) / 10] = add(dp[i][(p + q + 1) / 10], dp[i - 1][1]);
						}

						if(c[n - i] != '?'){
							break;
						}
					}

					if(b[n - i] != '?'){
						break;
					}	
				}

				if(a[n - i] != '?'){
					break;
				}
			}

			// printf("%d %d\n", dp[i][0], dp[i][1]);
		}
		printf("%d\n", dp[n][0]);
	}
	return 0;
}